Ads Attribution

SOLVE
Highlighted
New Contributor

We are using a Vue.JS website, Hubspot Forms API and Adwords.

Ad Attributions are not working. This is important to us because the Ads dashboard can show us the all important Customer Acquisition Costs.

 

Here is what is done. 

1) Adwords Auto Tagging Enabled

2) Hubspot Tracking Templates setup to use the utm parameters as well as the hubspot tracking template. 

 

As you may know Internet Explorer needs the # in the url to be compatible with Vue.js applications.

 

For Example we have a Final Url of https://momentumiot.com/#/getstarted The problem is google is putting the GCLID property before the #/getstarted, additionally the utm parameters in the tracking template append a ? to the final url which means that when someone clicks on our ad, the url they actually land on is  https://momentumiot.com/?gclid=EAFfD_BwE#/getstarted?utm_term=gps&utm_source=adwords&utm_medium=ppc&...

 

Notice the 2 ? in this url. One for the gclid and one for the utm_term. While this url actually works and we can see the Original Source Drill Down, referrer and original source the Ads attribution doesn't work.

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
HubSpot Moderator

Hi, @Justin4.

 

Thanks for your patience.

 

After further investigation, we have found that the Google Ads tracking template method, which HubSpot uses, is incompatible with single-page applications using hashes and AJAX fragments like /#/.

 

As outlined in Google's documentation:

 

If you use an anchor or AJAX fragment in your final URL and your tracking template appends extra parameters to the end of the final URL, then you must put all the tracking parameters in your final URL.

 

In practice, this means that you must manually add:

 

?{ignore}utm_term={keyword}&utm_source=adwords&utm_medium=ppc&utm_campaign={_utmcampaign}&hsa_cam={campaignid}&hsa_ad={creative}&hsa_acc=5421955974&hsa_mt={matchtype}&hsa_net=adwords&hsa_ver=3&hsa_src={network}&hsa_tgt={targetid}&hsa_grp={adgroupid}&hsa_kw={keyword}

 

after the https://momentumiot.com part of the final URL but before any # symbols whenever you create a new Google Ads campaign.

 

For example, if you want the campaign to send visitors to https://momentumiot.com/#/new-promotional-page, then you would end up putting

https://momentumiot.com/?{ignore}utm_term={keyword}&utm_source=adwords&utm_medium=ppc&utm_campaign={...

into Google Ads as the campaign's Final URL.

 

Per Google's documentation, all parameters which lie between an {ignore} token and a # will be treated as tracking parameters. This method of inserting tracking parameters before hashes and fragments is also consistent with RFC 3986 section 4.2.

 

For best results, I also recommend:

  1. Toggling off HubSpot auto-tracking for the "Momentum IoT" Google Ads account here in SettingsMarketingAdsAccounts.
  2. Removing the existing HubSpot tracking template from the account level in your Google Ads account. See the GIF below for the location of this setting.

Account level tracking template in _new_ AdWords experience.gif

 

Disabling auto-tracking and removing the tracking template from your Google Ads account is not necessary, but will prevent  hsa_ and utm tracking parameters from applying twice to your final URLs.

 

I am sorry that we couldn't find an ideal solution for you. The ads team now knows that Google Ads tracking templates are not compatible with URLs containing hashes or anchors and will try to advocate on behalf of customers like you until Google supports such URL structures. Please let me know if you have any additional questions.

Isaac Takushi

HubSpot Developer Support
5 Replies 5
Highlighted
HubSpot Moderator

Hi, @Justin4.

 

Apologies for the delayed response. Our team has been working to address posts as quickly as possible.

 

I've touched base with Kristen and can confirm that the different sets of query strings, delineated by the two ? symbols, prevent HubSpot's ads tool from recognizing the hsa_... parameters and properly attributing contacts.

 

I'll need to touch base with the ads team to determine whether we can apply the ads tracking template in a manner compatible with Vue.js URL hashes (e.g. appending the parameters to gclid instead of in their own query string). Stay tuned.

 

In the meantime, can you expound upon exactly what you mean by "Internet Explorer needs the # in the url to be compatible with Vue.js applications"? I know a little about Vue.js' compatibility issues with, for example, IE8, but I haven't found anything specifically citing hashes/fragment identifiers. Thanks for your help on this!

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
New Contributor

Thanks for your reply. Basically, IE 10 and IE 11 don't support the history api that VUE uses so the # needs to be there for IE 10 and IE 11 to work. 

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Thanks for clarifying, @Justin4.

 

The ads team is still investigating the issue. I'll update here when I have more information. You may also hear directly from Kristen, as she's looped in as well.

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hi, @Justin4.

 

Thanks for your patience.

 

After further investigation, we have found that the Google Ads tracking template method, which HubSpot uses, is incompatible with single-page applications using hashes and AJAX fragments like /#/.

 

As outlined in Google's documentation:

 

If you use an anchor or AJAX fragment in your final URL and your tracking template appends extra parameters to the end of the final URL, then you must put all the tracking parameters in your final URL.

 

In practice, this means that you must manually add:

 

?{ignore}utm_term={keyword}&utm_source=adwords&utm_medium=ppc&utm_campaign={_utmcampaign}&hsa_cam={campaignid}&hsa_ad={creative}&hsa_acc=5421955974&hsa_mt={matchtype}&hsa_net=adwords&hsa_ver=3&hsa_src={network}&hsa_tgt={targetid}&hsa_grp={adgroupid}&hsa_kw={keyword}

 

after the https://momentumiot.com part of the final URL but before any # symbols whenever you create a new Google Ads campaign.

 

For example, if you want the campaign to send visitors to https://momentumiot.com/#/new-promotional-page, then you would end up putting

https://momentumiot.com/?{ignore}utm_term={keyword}&utm_source=adwords&utm_medium=ppc&utm_campaign={...

into Google Ads as the campaign's Final URL.

 

Per Google's documentation, all parameters which lie between an {ignore} token and a # will be treated as tracking parameters. This method of inserting tracking parameters before hashes and fragments is also consistent with RFC 3986 section 4.2.

 

For best results, I also recommend:

  1. Toggling off HubSpot auto-tracking for the "Momentum IoT" Google Ads account here in SettingsMarketingAdsAccounts.
  2. Removing the existing HubSpot tracking template from the account level in your Google Ads account. See the GIF below for the location of this setting.

Account level tracking template in _new_ AdWords experience.gif

 

Disabling auto-tracking and removing the tracking template from your Google Ads account is not necessary, but will prevent  hsa_ and utm tracking parameters from applying twice to your final URLs.

 

I am sorry that we couldn't find an ideal solution for you. The ads team now knows that Google Ads tracking templates are not compatible with URLs containing hashes or anchors and will try to advocate on behalf of customers like you until Google supports such URL structures. Please let me know if you have any additional questions.

Isaac Takushi

HubSpot Developer Support
Highlighted
New Contributor
Reply
0 Upvotes