Ad tracking in HubSpot

Set up ad tracking in HubSpot and learn how HubSpot tracks which ads your contacts are clicking and converting on.

How ad tracking in HubSpot works

Tracking allows HubSpot to attribute contacts to specific ads, by applying tracking parameters to the end of your ad URLs. After you connect your ad account, HubSpot will apply tracking to ads that are currently active or pending review. If HubSpot is unable to track an ad, some reporting data from the network like clicks and impressions, will still display for that ad in the HubSpot ads tool.

HubSpot is only able to track the following types of ads for contact attribution:

  • Google Ads: HubSpot can track most Google ad types, including YouTube ads, but some ad types are not supported due to API limitations:
    • Smart campaigns can be tracked but reporting data for specific ad groups, ads, or keywords is not available.
    • Discovery campaigns cannot be tracked but you can review reporting data such as impressions or clicks on the Ads dashboard.
  • Facebook and Instagram Ads: HubSpot can track most Facebook and Instagram ads, but some ad types are not supported due to API limitations:
    • Ads that do not link to external sites (e.g., Facebook Messenger ads) cannot be tracked.
    • Ads that use the carousel format cannot be tracked.
  • LinkedIn Ads: HubSpot can track most LinkedIn ads, but some ad types are not supported due to API limitations:
    • Carousel or Message ads cannot be tracked.
    • Leads who submit Lead Gen Forms on any ad type will sync to HubSpot, even if the ad type is not trackable.

If you edit the name of an ad campaign, the utm_campaign value in HubSpot's tracking template will not automatically update. HubSpot will continue to track the ad, but if you rely on the utm_campaign parameter for other systems, you may need to update the ad URL. To update the URL to match the new ad campaign name, do one of the following:

  • In the ad network, manually edit the ad campaign URL to reflect the new name.
  • In the ad network, remove the utm_campaign parameter and value entirely, then save. HubSpot will detect the missing parameter and automatically update the URL.

Auto tracking

To track ads in an ads account, ensure that auto-tracking is enabled.

  • In your HubSpot account, click the settings icon settings in the main navigation bar.
  • In the left sidebar menu, navigate to Marketing > Ads.
  • For each ad account, click to toggle the Auto tracking switch on.

enable-auto-tracking

  • To disable HubSpot tracking for your ads, click to toggle the Auto tracking switch off. This will remove HubSpot access to your tracking settings, but will not remove the existing tracking parameters from your ads. You can remove these parameters from within Google AdsFacebook Ads, and LinkedIn Ads.
  • By default, HubSpot's tracking template includes utm parameters to match HubSpot's traffic analytics. If you want to override the utm_source or utm_medium parameters to match a third-party reporting service like Google Analytics, you can edit the HubSpot tracking template:
    • Locate the ad network of the tracking template you want to edit.
    • Click Edit tracking template above the table of connected ad accounts for the ad network.
    • In the right panel, enter a new utm_source or utm_medium.
    • Click Save.

Please note: HubSpot can only attribute contacts to the ads they clicked after auto-tracking is enabled. Contacts will not be attributed to the ads they clicked while auto-tracking is disabled.

Facebook Ads

HubSpot tracks Facebook ads by adding the following URL parameters to each ad:

utm_source=facebook
utm_medium=paid
utm_campaign={Name of Ad campaign}
hsa_acc={accountid}
hsa_cam={adcampaignid}
hsa_grp={adsetid}
hsa_ad={ad_id}
hsa_net=facebook
hsa_src=[SOURCE_SITE_NAME] - set to Facebook or Instagram automatically
hsa_ver=3
hsa_la={true} - for lead ads, {false} or absent otherwise
hsa_ol={true} - for organic leads from lead ads, {false} or absent otherwise

These parameters are automatically added when your Facebook Ads account is connected to HubSpot. Any changes made to the UTM parameters in Facebook Ads will not be overwritten by HubSpot. HubSpot's ads tool updates multiple times a day to ensure new ads are being tracked.

Requirements for tracking Facebook ads

  • The final URL in the Facebook ad must be a full URL and not shortened by a link shortener (e.g., bit.ly, with the exception of hubs.ly). Link shorteners strip parameters from the end of the URL and prevents tracking.
  • The URL in the Facebook ad cannot redirect because HubSpot's tracking parameters are stripped during redirects.Only use the final, non-redirecting version of a URL. This includes http to https redirects.
  • Existing ads must have fewer than 20 engagements when you first connect your Facebook Ads account to HubSpot to be tracked. This prevents Facebook's ad optimization algorithm from being reset. If an ad has 20 or more engagements, you can override the limit to apply HubSpot tracking.

If you meet all of the above requirements but are seeing errors, check out the tracking troubleshooting guide.

Necessary disclosure: if you share data from your HubSpot account with Facebook as part of the HubSpot Ads integration, Facebook's ad terms will apply. When you authorize the integration, HubSpot receives a user token with permissions on the connected ad accounts and pages. HubSpot can view but does not store all the ad accounts and pages you have permission for. Facebook will share settings details (e.g., name, budget, bid strategy, creative) and performance metrics (impressions, clicks, etc.) for all campaigns, ad sets, and ads in the ad accounts you connected.

Override Facebook Ads tracking limits for existing ads

When you enable auto tracking for your Facebook Ads account, HubSpot will apply tracking templates to your existing ads. By default, HubSpot will not apply a tracking template to Facebook ads that have more than 20 engagements. This is done automatically due to Facebook's ad optimization procedures.

HubSpot will display an error message next to any Facebook ads that aren't being tracked due to engagement limit. 

tracking_alert_campaigns_page
To track a Facebook ad that has reached its engagement limit:

  • In your HubSpot account, navigate to Marketing > Ads.
  • Click the ad campaign that the untracked ad is under.
  • Click the ad set that the untracked ad is under.
  • Hover over the ad, then in the alert, click Fix alert.

    tracking_alert_alert-fix-this
  • In the dialog box, click Yes, add tracking.

    tracking_alert_confirmation-1

HubSpot will then append its tracking parameters to the ad, allowing you to track engagements on that ad in HubSpot.

Google Ads

HubSpot tracks Google ads by applying a tracking template at the campaign level. Any parameters specified on the account or campaign level will be merged with the HubSpot parameters at the campaign level, and will not be overwritten by HubSpot. 

HubSpot adds the following URL parameters to each Google ad:

utm_term={keyword}
utm_source=adwords
utm_medium=ppc
utm_campaign={_utmcampaign} - set by default to the name of the Ads campaign
hsa_cam={campaignid}
hsa_grp={adgroupid}
hsa_mt={matchtype}
hsa_src={network}
hsa_ad={creative}
hsa_acc={ID of account/customer}
hsa_net=adwords
hsa_kw={keyword}
hsa_tgt={targetid}
hsa_ver=3

Please note: when HubSpot's ad tracking template is applied to your Google ads, the update will be reflected in the Change History of your Google Ads account. The user associated with the change will be the user who connected the ad account to HubSpot.

Requirements for tracking Google Ads

  • The destination URL in the Google ad must be a full URL and not shortened by a link shortener (e.g., bit.ly, with the exception of hubs.ly). Link shorteners strip parameters from the end of the URL and prevents tracking.
  • Only use the final, non-redirecting version of a URL. This is because a redirect will remove HubSpot's tracking parameters. This includes http to https redirects and third-party click tracking services.
  • Customized tracking parameters should not be added at the ad group or ad level, as HubSpot's parameters do not take precedence over them.
  • Existing custom tracking parameters or tracking templates at the campaign level must either be blank or start with {lpurl} for HubSpot to track the ad.

If you meet all of the above requirements but are seeing errors, check out the tracking troubleshooting guide.

Necessary disclosure: your use of the Google Ads integration is subject to the Google Ads Terms and Conditions. HubSpot will be able to view and manage your account, and will store your Google Ads account number. When you authorize the integration, HubSpot receives a user token with permissions on the connected ad accounts. HubSpot can view but does not store all the ad accounts you have permissions for. Google will share settings details (e.g., name, budget, bid strategy, creative) and performance metrics (impressions, clicks, etc.) for all campaigns, ad groups, and ads in the accounts you connected.

Google auto-tagging

Google auto-tagging is also compatible with HubSpot's ad tracking template. To set up auto-tagging, you'll need to manually update your tracking template in your Google Ads account:

  • Navigate to your Google Ads account.
  • In the left sidebar menu, click Settings, then click Account Settings.
  • Click Tracking.
  • Under Tracking Template, enter the parameters below, replacing the value for hsa_acc with the account ID of your Google Ads account.
{lpurl}?utm_feeditemid={feeditemid}&utm_device={device}&utm_term={keyword}&utm_source=google&utm_medium=ppc&utm_campaign={_utmcampaign}&hsa_cam={campaignid}&hsa_grp={adgroupid}&hsa_mt={matchtype}&hsa_src={network}&hsa_ad={creative}&hsa_acc={ID of account/customer}&hsa_net=adwords&hsa_kw={keyword}&hsa_tgt={targetid}&hsa_ver=3

autotagging-in-google-ads-account-1

LinkedIn Ads

HubSpot tracks LinkedIn ads by applying a tracking template to the supported formats of Sponsored Content.

HubSpot adds the following URL parameters to each LinkedIn ad:

utm_source=linkedin
utm_medium=paid
utm_campaign={name of ad campaign}
hsa_net=linkedin
hsa_ver=3
hsa_acc={accountid}
hsa_cam={campaigngroupid}
hsa_grp={campaignid}
hsa_ad={creative}

Requirements for tracking LinkedIn ads

  • The final URL in the LinkedIn ad must be a full URL and not shortened by a link shortener (e.g., bit.ly, with the exception of hubs.ly). Link shorteners strip parameters from the end of the URL and prevents tracking.
  • The URL in the LinkedIn ad cannot redirect because HubSpot's tracking parameters are stripped during redirects. Only use the final, non-redirecting version of a URL. This includes http to https redirects.
  • LinkedIn automatically shortens long ad URLs. LinkedIn's automatic link shortening is compatible with HubSpot's tracking and will not interfere with HubSpot's ability to apply the tracking template.

If you meet all of the above requirements but are seeing errors, check out the tracking troubleshooting guide.

Necessary disclosure: your use of the LinkedIn Ads integration is subject to LinkedIn's terms and conditions. HubSpot will be able to view and manage your account, as well as store your LinkedIn Ads account number. When you authorize the integration, HubSpot receives a user token with permissions on the connected ad accounts and pages. HubSpot can view but does store all the ad accounts and pages you have permissions for. LinkedIn will share settings details (e.g., name, budget, bid strategy, creative) and performance metrics (impressions, clicks, etc.) for all campaign groups, campaigns, and ads in the ad accounts you connected.

Troubleshoot ad tracking issues

An error will display on any ad that HubSpot cannot track. When tracking errors occur, HubSpot will not apply a tracking template to your ad, and contacts will not be attributed to those ads. Reporting data such as click and impression counts will still display. Check out the tracking troubleshooting guide to learn how to resolve tracking errors.

HubSpot will start tracking your ads and attributing contacts after the error is resolved.