HubSpot Tag Sync

What is HubSpot?

HubSpot is a customer relationship management (CRM) platform that provides tools for marketing, sales, customer service, and content management. The HubSpotTag integration allows websites to incorporate HubSpot’s tracking functionality to collect visitor data and link it to CRM records. This integration enables user identification, behavior tracking, and attribution reporting. HubSpot's tracking capabilities are driven by a JavaScript tag that collects and stores user identifiers like hubspotutk.

Product Type: CRM

Integration Type: Starter Kit & ID Sync


Capabilities

  • Captures hubspotutk from the HubSpot tag’s cookies for user tracking and identification.
  • Drops the HubSpot tracking tag on the page to enable CRM-based session tracking and analytics.
  • On an identify call, triggers _hsq.push(['identify', {...traits}]) to associate traits with a known user.
  • Supports client-side cookie-based storage with values used in server-side event enrichment.
  • Enables downstream enrichment of event data for marketing automation and customer insights.

Considerations

  • The lifetime of cookies and stored values is configurable via the Cookie Lifetime UI setting.
  • The tag drops cookies automatically as part of its normal tracking behavior.

Sync Details

  • IDs:

    • hubspotutk – A unique visitor identifier set by the HubSpot tag to associate page views and events with individual users in HubSpot's CRM.
  • Description:

    • The sync captures hubspotutk from the cookie set by the HubSpot tag.
    • Each value is stored in first-party storage for the duration defined by the Cookie Lifetime setting.
    • Values are refreshed when new data is detected.
    • The identifiers are added to server-side event payloads for user identification and attribution.
  • Server-side Event Payload:
    Upon completion of all vendor's sync, the server-side events will incorporate all resolved identifiers as described above. The following object will be appended to the context.providers property within the event's JSON payload.

    {
      "hubSpotTag": {
        "fired": "time stamp when tag was dropped",
        "hubspotutk": "the value of the hubspotutk cookie, created by the HubSpot tag"
      }
    }
    
    
  • Cookie Name:

    • Cookie: _meta_hubSpotTag_fired, _meta_hubSpotTag_hubspotutk
    • IndexedDB: [your storage prefix]_hubSpotTag_fired, [your storage prefix]_hubSpotTag_hubspotutk
    • For a general guide on ID Sync validation, see here.

Sync Setup Guide

1. Gather Credentials

  • To obtain your Client ID, log into your HubSpot account and retrieve it from your tracking settings or account overview page. If you’re unsure where to find it, contact HubSpot support for assistance.

2. Add a HubSpotTag Sync in MetaRouter

To gather the hubspotutk and drop the HubSpot tag for user tracking, you must add a HubSpotTag sync.

  1. From the Pipelines page, find the pipeline associated with the web property you’d like to add a sync to. Hover over the three dot dropdown and select “Build AJS File.”
  2. In the Identity Syncs section, select the HubSpotTag sync.
  3. Fill out the following fields:
    1. Cookie Lifetime (in days) – Number of days the value will persist in storage if not refreshed (e.g., 30).
    2. Client ID – The unique HubSpot client ID used to initialize the tag (e.g., "6912381").
    3. Fire On ReSync – Boolean indicating whether to re-fire the sync on identity calls (e.g., true).
  4. Scroll down and click the Save and Build File button.
  5. Deploy your AJS file to propagate changes to your web property.