Intergrator For HubSpot

WooHub is an open source plugin for integrating WooCommerce Customers and HubSpot Contacts. Customers from your WooCommerce website are automatically created and updated in HubSpot when they register or update their account details.

Basic WooCommerce & HubSpot intergration


Plugin has some composer dependencies.
If installing from git or composer run composer install before activating


Add your HubSpot API Key in Settings > WCHub


Woocommerce/Wordpress customers will automatically be pushed to HubSpot when a user registers, logs in or updates their account or billing address.

To manually update a Hubspot Contact use the function wc_hub_create_or_update_hubspot_contact($user)


// Create or update a hubspot contact from a WP_User object
$wc_hub_contact_id = wc_hub_create_or_update_hubspot_contact( $user );

// Get an existing WooHub Contact record for current user
// @see
$contact = wc_hub_get_current_contact();

// Get an existing HubSpot Contact from a WP_User object
// @see
$contact = wc_hub_get_hubspot_contact( $user );

// Update an existing HubSpot contact
// @see 
$properties = [
    ['property' => 'firstname', 'value' => 'Sam'], 
    ['property' => 'lastname', 'value' => 'Iam'],
    ['property' => 'custom_property', 'value' => 'custom value']
wc_hub_update_hubspot_contact( $current_user->user_email, $properties);


// Called when a HubSpot Contact is Created or Updated
add_action('wc_hub_hubspot_contact_updated', 'handle_wc_hub_hubspot_contact_updated', 10, 2);

function handle_wc_hub_hubspot_contact_updated( $hubspot_id, $user ) { 


// Modify default properties when a HubSpot contact is created
add_filter( 'wc_hub_hubspot_contact_properties', 'handle_hubspot_contact_props_filter', 10, 2 );

function handle_hubspot_contact_props_filter( $properties, $user ) {

    $properties[] = [
        'property' => 'wordpress_username',
        'value' => $user->user_login

    return $properties;

// Modify what HubSpot Contact Properties are returned use the `wc_hub_hubspot_get_contact_parameters` filter.
// See  for more details.
add_filter( 'wc_hub_hubspot_get_contact_parameters', 'handle_wc_hub_hubspot_get_contact_parameters', 10, 1 );

function handle_wc_hub_hubspot_get_contact_parameters( $parameters ) {

    $parameters = ['showListMemberships' => 1, 'property' => 'lastname'];

    return $parameters;