ads

Ad tracking in HubSpot

Last updated: November 19, 2019

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. To attribute contacts to your ads, HubSpot applies tracking parameters to the end of your ad URLs. This allows HubSpot to determine the specific ad a contact has interacted with. If HubSpot is unable to track an ad, reporting information, such as 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 it cannot report on or track Google Smart Campaigns due to API limitations.
  • Facebook Ads: HubSpot can track most Facebook ad types but it cannot track ads placed on Instagram stories or Instagram feeds, and ads on Facebook that do not link to external sites (e.g., Facebook Messenger ads).

Please note: while Facebook has a feature that allows you to crop your ad images to the 1.91:1 aspect, their API no longer supports this feature. Because of this, Facebook may prevent HubSpot from tracking ads with these cropped images. It is recommended that ad images are cropped outside Facebook to prevent any ad tracking issues.

  • LinkedIn Ads: HubSpot is only able to track LinkedIn single image ads. 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.

ad-accounts-auto-tracking-1

  • 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 Ads, Facebook Ads, and LinkedIn Ads.

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:

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
utm_source=facebook
utm_medium=paid
utm_campaign={Name of Ad campaign}
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 troubleshooting section below.

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. Google auto-tagging is also compatible with HubSpot's ad tracking template.

HubSpot adds the following URL parameters to each Google ad:

hsa_cam={campaignid}
hsa_grp={adgroupid}
hsa_mt={matchtype}
hsa_src={ad network}
hsa_ad={creative}
hsa_acc={ID of account/customer}
hsa_net=adwords
hsa_kw={keyword}

utm_term={keyword}
hsa_tgt={targetid}
utm_campaign={_utmcampaign} - set by default to the name of the Ads campaign or, if you associate your ad with a HubSpot campaign, the HubSpot campaign name
utm_source=adwords
utm_medium=ppc
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.
  • HubSpot is not able to track or report on Smart Campaigns (formerly Google Express Campaigns). If your Google Ads account is in Smart Mode, your ads will not display in HubSpot. Learn how to check if your Google Ads account is in Smart Mode.

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

LinkedIn Ads

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

Please note: if multiple ads link to the same content, they will have the same creative ID, and only the first ad will receive credit for conversions. If an ad is created for an existing LinkedIn post, the same tracking will be applied to the ad and the existing post, and HubSpot will not be able to differentiate between organic and paid interactions. For these reasons, it's recommended to create new, individual Sponsored Content in LinkedIn for accurate tracking.

HubSpot adds the following URL parameters to each LinkedIn ad:

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

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 troubleshooting section below.

Troubleshoot ad tracking issues

An error will display on any ad that HubSpot cannot track. You can drill down into a campaign to see the specific ad(s) affected by the error. If any of the following issues 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. HubSpot will start tracking your ads and attributing contacts after the error is resolved.

  • Auto-tracking is turned off: to resolve this issue, turn auto-tracking on for the ad account(s) in your HubSpot ads settings.
  • Insufficient permissions: the user who connected the ads account to HubSpot doesn't have sufficient permissions for the account or business page. To resolve this issue, ensure the user has the correct permissions for the Facebook Ads, Google Ads, or LinkedIn Ads account, and sufficient permissions for the relevant Facebook or LinkedIn business page(s).
  • Redirected ad URLs: redirected URLs are not compatible with HubSpot's ad tracking because URLs will lose all tracking parameters during the redirect. To resolve this issue, use the full, final URL for each ad, and don't use click tracking services that require a redirect.

    The following are the most common redirect situations that result in errors:
    • Link-shortening services, such as bit.ly and hubs.ly.
    • Click tracking services that require a redirect.
    • URLs that redirect from an http to an https version of your page.
  • The HubSpot tracking template has been edited (Google Ads only): this error displays when your tracking template in your Google Ads account or campaign settings does not start with {lpurl}. This may have occurred due to external click tracking services, such as Clickserve, automatically updating the tracking template. To resolve this, manually apply HubSpot's tracking template to your Google Ads account settings:
    • Log in to your Google Ads account.
    • In the left sidebar menu, click Settings.
    • Click the Account Settings tab.
    • In the Tracking section, enter each of the parameters from HubSpot's tracking template into the Final URL suffix field.
      ad-tracking-Google
    • Set the proper numerical values for your account ID for the hsa_acc.
  • Too many engagements (Facebook Ads only): Facebook uses an algorithm to optimize ads in their network. To prevent interfering with this optimization, HubSpot will not apply tracking to any ads that have more than 20 engagements at the time a Facebook Ads account is connected to HubSpot. To resolve this, duplicate the ad to create a new version with no engagements. You can also, manually apply HubSpot's tracking template to the ad in your Facebook Ads account:
    • In your Facebook Ads account, navigate to the Ad Manager.
    • Locate the campaign to edit, then click Edit.
    • Click the specific ad to edit.

      a-d-tracking-in-facebook-1
    • In the Tracking section of the editor, click Build a URL parameter.
    • Enter in each of the parameters from HubSpot's tracking template, omitting the hsa_src parameter (this is a variable that can only be added via API).
    • Set the proper numerical values for your account ID, campaign ID, ad group ID, and ad ID for the hsa_acc, hsa_cam, hsa_grp, and hsa_ad parameters respectively.
  • Overriding customized tracking (Google Ads only): in Google Ads, customized tracking parameters on the ad group or ad level will override HubSpot's tracking template. To resolve this issue, remove any customized tracking on the ad group and ad level in your Google Ads account:
    • To remove custom parameters from the ad group:
      • In your Google Ads account, navigate to your campaigns.
      • In the left menu, click Ad groups.
      • Select the checkboxes next to the ad groups you want to edit, or select the top checkbox to select all ad groups (recommended).
      • Click the Edit dropdown menu and select Change tracking templates.
      • Leave the field blank and click Apply to remove any existing tracking templates.
      • Click the Edit dropdown menu again and select Change custom parameters.
      • Select Remove parameters and click Apply to remove any additional custom parameters.
edit-google-a-dgroup-tracking
    • To remove custom parameters from individual ads:
      • In the left menu, click Ads & extensions.
      • Select the checkboxes next to the ads you want to edit, or select the top checkbox to select all ads (recommended).
      • Click the Edit dropdown menu and select Change tracking templates.
      • Leave the field blank and click Apply to remove any existing tracking templates.
      • Click the Edit dropdown menu again and select Change custom parameters.
      • Select Remove parameters and click Apply to remove any additional custom parameters.

        edit-google-a-d-level-tracking

Please note: customized tracking on the campaign or account level does not interfere with HubSpot's tracking template, and is therefore compatible with HubSpot's ads tracking. Parameters added on the campaign or account levels in Google Ads will merge with the existing parameters in HubSpot's tracking template.

  • Your ad is using shared content or the tracking has been edited (LinkedIn only): this error indicates that you have multiple ads pointing to the same post on your LinkedIn company page. Since LinkedIn uses the same identifiers for ads made for the same published post, interactions will only be attributed to the first ad. It's recommended that you create one ad for each existing post on your LinkedIn company page, or create a new post for each Sponsored Content ad
  • We can’t track your ads right now. We'll automatically try again every day: this error displays when HubSpot is unable to apply tracking to your ad, but is not getting more specific information from the network about the issue. If this error does not resolve itself, please contact HubSpot Support.
  • Unable to track this campaign type: this error displays for ad formats that cannot be tracked by HubSpot due to ad network API limitations.

Once an issue is resolved, HubSpot will attempt to apply the tracking template again within 15 minutes.

Please note: the ad networks' interfaces frequently update, and while HubSpot monitors these changes closely, the screenshots included here may not always match what you see in your ads account.

/ads/ad-tracking-in-hubspot?hs_ungate__cos_renderer_combine_all_css_disable=true&hsSkipCache=true