Every online visitor leaves a unique ‘Client ID’ by means of cookies. You can use this ID to find out who visited your website, at what times, and what they did while there. If the Paylogic Frontoffice is integrated into your website by using an iFrame, all the internet traffic of the Frontoffice will be displayed as ‘direct traffic’ within Google Analytics. This way it can’t be deduced whether a specific Client ID comes from Google, Facebook or any other webpage. The solution for this is setting up ‘cross-domain tracking’.
By using cross-domain tracking, two sessions on affiliated websites (e.g. the Paylogic Frontoffice and your own website) can be regarded as one. This is also called website pairing. This guide provides a step-by-step explanation on how to correctly set up cross-domain tracking.
Step 1: Adding exclusion reference(s)
To find out where your visitors initially came from, it is important that your own website is ignored as referral in Google Analytics. In addition, it is useful to exclude www.paylogic.nl and www.paylogic.com, as well as any websites of different banks. Go to ‘Manage’, and select ‘List with exclusion references’ below ‘Tracking info’.
Choose ‘Add exclusion reference’ and add the required exclusions.
Step 2: Implementing the cross-domain iFrame
What is important now is that there must be a cookie transfer between the website (your domain) and the URL of the iFrame/shop (our domain). With the script below you can integrate the iFrame, including cross-domain tracking.
Note: make sure that ‘Paylogic_Frontoffice_URL1’ is replaced by the correct Frontoffice URL from the Backoffice & ‘Analytics_UID’ by the right tracking pixel.
<iframe width="600" height="800" border="0" style="max-width: 100%;
" id="paylogic_shop" src="Paylogic_Frontoffice_URL1"></iframe>
<script>(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', 'Analytics_UID', 'auto');
ga('send', 'pageview');
var linker;
function addiFrame(divId, url, opt_hash) {
return function(tracker) {
window.linker = window.linker || new window.gaplugins.Linker(tracker);
//var iFrame = document.createElement('iFrame');
var iFrame = document.getElementById(divId);
iFrame.src = window.linker.decorate(url, opt_hash);
//document.getElementById(divId).appendChild(iFrame);
};
}
// Dynamically add the iFrame to the page with proper linker parameters.
ga(addiFrame('paylogic_shop', document.getElementById('paylogic_shop').src));
</script>
(Optional) Step 3. Creating the right views and filters in Google Analytics
Having successfully implemented cross-domain tracking, you now have the option to create views and filters in Google Analytics for your reports. To do this, go to ‘Manage’ and choose ‘Filters’, after which you can add a filter.
Within such a filter it’s possible to indicate which domain(s) you specifically would like to stand out in this view.
Do you have any further questions about cross-domain tracking & Online Marketing? Please contact your Client Success Manager.