Cross Domain Tracking Google Analytics
In a project I am currently using something similar to the following:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-123456789-1');
</script>
On this site, we currently have the following flow during sign up:
Email Landing Page (domaina.com) ->
Registration Page (domainb.com) ->
Payment Provider (payment.com) ->
Confirmation Page (domainb.com).
We would like to track users from the first step of this process (domaina.com) through all the other domains and up to the confirmation page.
We have no control over the code on the payment.com page but we can control all others.
What I am wondering is how to track across these domains?
From what I can see, I can add something similar to the following:
'linker': {
'domains': ['domaina.com', 'domainb.com', 'payment.com']
}
}
as part of the config. However, if we don't have GA on the payment.com page, will this still track across those sites?
Answer
You can only track hits for the domains on which you can place the GA code for the GA accounts that you own. Therefore payment.com
won't be tracked in GA.
What will happen in your reporting view is:
- User goes to
domaina.com
-> all hits tracked - User taken to
domainb.com
-> all hits tracked - User taken to
payment.com
-> no hits recorded - User returns to
domainb.com
-> all hits tracked
The problem lies in Step 4. When the user returns, they may be seen as a referral
from payment.com
, thus starting a new session and all revenue will be attributed to payment.com
(instead of what brought the user to domaina.com
in the first place).
To overcome this, add payment.com
to your referral exclusion list
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM