I have successfully implemented Cross-Domain tracking with Google Analytics (1 session as user jumps across domain, same _ga cookie on both domains, etc.) However, when the user jumps to the second domain and completes a purchase, the eCommerce transaction is not getting attributed to the utm custom campaign from the first page. It seems you can't pass the utm custom campaign information cross-domain. Is this true? Has anyone ran into this before?
I found my issue, cache. I have done hard refreshes before every test, but I went into Chrome tools and clear EVERYTHING. Cookie, cache, everything. And Cross-Domain tracking for Custom Campaigns started working! For reference here are the scripts for the two sites:
Site 1:
ga('create','UA-xxxxxxx-x'','auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', ['site2.com']);
ga('require','ecommerce','ecommerce.js');
ga('send','pageview');
Site2:
ga('create', 'UA-xxxxxxx-x', 'auto', { 'name': 'client', 'allowLinker': true });
ga('client.require', 'linker');
ga('client.linker:autoLink', ['site1.com']);
ga('client.require', 'ecommerce', 'ecommerce.js');
ga('client.send', 'pageview');
Also, I added site1.com and site2.com to the Referral Exclusion List in GA and the UA key for site 1 and site 2 are the same.
Related
I am getting the below error in Google Analytics, suggesting I do not have the correct tracking code on my site, though I do. I'm using cookies-eu-banner, and have the below code on my site.
What could be causing this? If I visit the page this is logged in Google Analytics in the real time view, so it seems to be working but the error suggests something is awry.
Code
new CookiesEuBanner(function () {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'MYTRACKINGCODE', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['subscriptions.thestage.co.uk']);
ga('require', 'displayfeatures');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
…other tracking code…
}, true);
Error
The Ad Destination URL https://www.MYSITE from the AdWords account MYACCOUNT has accrued a significant number of clicks but a lower-than-expected number of sessions because the page is not tagged with a supported version of the Google Analytics tracking code.
If your pages do not include a supported version of the Analytics tracking code, then Analytics cannot collect data for those pages.
To find the right tracking code for your property, on the Analytics Admin page in the Property column, click Tracking info, then click Tracking Code.
Google Tag Assistant Recordings can help you ensure that your tracking code is sending hits as expected.
I have an issue with cross domain tracking for one of my clients.
When people go from one site to the the other they go to a different domain. There they finnish a servey and they convert on that site.
I have analytics set up and the data comes in from both websites, but the conversions are registered for direct en referral. I want to know what keywords in Adwords turned into the conversion.
can someone help me with this issue?
You'll need to set up cross domain tracking as described in this support article.
If you use Google Tag Manager, you can use the "Auto Link Domains" functionality that will take care of the details.
Otherwise, you'll essentially have to change the intialization of your tracking snippet from
ga('create', 'UA-XXXXX-Y', 'auto');
to
ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['your-second-domain.com'] );
Note that these solutions always require that you use the same Analytics property ID on both sites.
We are trying to attribute user actions that happen after a user has signed in to the marketing channel they originated from. To do this, we use the standard Google Analytics JS library as well as the Measurement Protocol. Events get tracked in Google Analytics and they are visible in the events view. However, they do not get attributed to the correct campaign and only show up under the Direct channel.
Our process is as follows:
The user gets tracked with front end Google Analytics JS on our site:
ga('create', ‘UA-XXXXX-Y’, 'auto');
ga('send', 'pageview');
A userId gets assigned to the user in Google Analytics as soon as they sign up:
ga('create', ‘UA-XXXXX-Y’, 'auto');
ga('set', 'userId', 'fe8220b3');
ga('send', 'pageview');
Once a certain action we would like to track happens, we send a GET request to the Measurement Protocol with the following params:
v: 1,
t: 'event',
tid: ‘UA-XXXXX-Y’,
cid: ‘555’,
uid: ‘fe8220b3’,
ec: ‘backend_action’,
ea: ‘action’
This correctly tracks the event, but does not associate it with the user. As far as I understand, since we have provided the same UserId in our params that we did when identifying the user, the attribution should happen automatically in Google Analytics. Am I misunderstanding how this works?
I manage multiple e-commerce sites that all share the same checkout process but have individual google-analytics accounts. Under the old google analytics for cross-domain tracking we used:
['_setDomainName', 'none']
When on the SSL checkout part of the process.
Under universal analytics I understand you can use linker plugin for cross-domain tracking but I don't see an equivalent to the 'none' configuration above. What is the correct way to achieve this?
I hope I understand your problem correctly. The best explanation is on the Google Documentation page but I'll try to make a summary.
The _setDomainName configuration, on ga.js, sets the domain name for the Google Analytics cookies:
_gaq.push(['_setDomainName', 'mywebsite.com']);
On analytics.js, the new way to do this is:
ga('create', 'UA-XXXXX-Y', {
cookieDomain: 'mywebsite.com'
});
And if you'd like to use the legacy cookies (from ga.js), you also should populate the legacyCookieDomain setting:
ga('create', 'UA-XXXXX-Y', {
cookieDomain: 'mywebsite.com',
legacyCookieDomain: 'mywebsite.com'
});
There are two ways to have an equivalent to the 'none' configuration. The first one is:
ga('create', 'UA-XXXX-Y', {
'cookieDomain': 'none'
});
But Google suggests to use this solution to set cookies on localhost. The second solution is sending data directly to Google Analytics without the use of cookies.
ga('create', 'UA-XXXX-Y', {
'storage': 'none',
'clientId': '35009a79-1a05-49d7-b876-2b884d0f825b'
});
Here you'll have to supply your own clientId parameter.
Background
We have a number of websites that we maintain and we have Google AdWords Campaigns running to drive traffic to these sites.
For Example:
www.example1.co.uk
www.example2.co.uk
www.example3.co.uk
After browsing these sites, a customer will be redirected to our E-Commerce platform if they decide to make a purchase (this is where the conversion happens):
www.example-checkout.com
Current Google Analytics Setup
Our current Google Analytics Setup looks like this:
www.example1.co.uk, www.example2.co.uk, www.example3.co.uk
ga('create', 'UA-12345678-1', 'auto', {'name': 'globalTracker'});
ga('globalTracker.send', 'pageview');
ga('globalTracker.require', 'linker');
ga('globalTracker.linker:autoLink', ['example-checkout.com'], true);
www.example-checkout.com
All Pages
ga('create', 'UA-12345678-1', 'auto', {'allowLinker': true, 'name' : 'globalTracker'});
ga('globalTracker.send', 'pageview');
Checkout Page Only
The checkout/confirmation/thank you page contains additional calls to load the Google Analytics E-Commerce plugin and post the details of the transaction that has occurred.
ga('create', 'UA-12345678-1', 'auto', {'allowLinker': true, 'name' : 'globalTracker'});
ga('globalTracker.send', 'pageview');
ga('globalTracker.require', 'ecommerce', 'ecommerce.js');
ga('globalTracker.ecommerce:addTransaction', {
'id': '${transactionID}',
'affiliation': '${affiliation}',
'revenue': '${revenue}',
'shipping': '${shipping}',
'tax': '${tax}'
});
ga('globalTracker.ecommerce:send');
What Works
The E-Commerce tracking code appears to work and conversions are recorded. In Google Analytics we can see that we received traffic/clicks from our AdWords campaigns which suggests that the _ga cookie is being correctly passed cross-domain from www.example1.co.uk to www.example-checkout.com (in fact I have verified this using the Chrome Developer Tools / Google Analytics Debugger Plugin).
Problem
The problem is that the conversions are never attributed to the AdWords Campaign & AdGroup. The source of the conversion is always a referral (E.g. from www.example1.co.uk).
What am I missing? I want to see the conversions attributed to the AdWords campaign. I.e. in the "Acquisition -> Campaigns" section of Google Analytics.
Any pointers are greatly appreciated.
You do not mention that you use any decorator functions (i.e. functions that add the ga parameter to outgoing links, forms etc.) and allowLinker does not do this automatically. So it should be not possible that cross domain tracking works at all (i.e. both domains will be tracked but on changing the domain the user will start a new tracking session). (UPDATE: Sorry, I did not see the autolinker plugin in the code, so ignore this paragraph).
Plus you need to add both domains to the referrer exclusion list in the property settings (this will remove the referrer no matter what, so make sure that the client id is passed on before you do that).
Unless you have used decorators without saying so in the question this is most likely your problem. Look into the outgoing urls if the ga parameter is appended when switching domains and make sure that the ga code on the other domain does actually receive the parameter (i.e. if there are redirects make sure they retain the parameter).