How to set up Google Analytics to track user engagement from your site through completion of the Roobrik survey
Cross-domain tracking is a Google Analytics configuration that allows you to send a user’s anonymized client ID from your website to the Roobrik survey and preserve the session information. That way, the user is being tracked as the same person across the two websites. The _ga cookie (that Google Analytics uses to identify visitors) has the same value on your website AND tools.roobrik.com.
How does Roobrik enable this?
Because you need to have access to both websites you want to track, Roobrik will request your Google Tag Manager (GTM) container code. We place it on the landing page and dashboard of the survey. Once complete you need to follow the steps below to enable cross-domain tracking.
How do I enable this?
There are four steps for setting up cross-domain tracking:
1. Use the Same Google Analytics Property
Cross-domain tracking requires your website and Roobrik be tracked in the same Google Analytics property. The options are below. Choose the one that best fits your capabilities and reporting needs.
-
- use your current Google Analytics property
- create a new property that combines activity from both websites
You’ll be tracking two domains in the same property, so we recommend adding a filter
to display the full URLs in your pages reports. If you decide to use your current Google
Analytics property, make sure any hostname filter you may be using is updated to include tools.roobrik.com.
2. Add Linker Parameter
Because users will get to the Roobrik survey via a link on your website, you will need to update the Google Analytics Settings variable or Google Analytics tags in GTM to auto-link domains. Since users could navigate back and forth between your site and Roobrik, add both domains.
3. Enable the allow Linker Field
By default, Google Analytics does not care about the _ga query parameter in the URL, so you need to explicitly instruct GA to fetch the _ga parameter in the URL and update the cookie accordingly. Update the Google Analytics Settings variable or Google Analytics tags in GTM by adding allowLinker = true to the Fields to Set.
4. Update the Referral Exclusion
Since the referrer and the current page domain are different, Google Analytics by default will start a new session for users who click from your site to Roobrik. You want Google Analytics to see this activity in one session, so you need to update it to ignore self-referrals. Update the Referral Exclusion List in the Google Analytics property that you decided to use in Step 1 by adding tools.roobrik.com (your website should already be listed).
Additional Resources
Google Support
https://support.google.com/analytics/answer/1034342?hl=en#zippy=%2Cin-this-article
Google Developers
https://developers.google.com/analytics/devguides/collection/gtagjs/cross-domain