Cross-Domain Tracking in Google Analytics
Let’s Know more about Cross-Domain Tracking in GA.
The Journey with “Digital Analytics Minidegree” on CXL Institute is Continue and this is the 12th Post.
the instructor of the course is Chris Mercer really good. Thanks, Mr. Mercer.
Cross-domain measurement overview
To measure sessions, Analytics collects a Client-ID value in every hit. Client-ID values are stored in cookies. Cookies are stored on a per-domain basis, and websites on one domain cannot access cookies set for one more domain.
after you measure sessions across multiple domains, the Client-ID value should be transferred from one domain to the opposite. To do this, the Analytics code has linking features that allow the source domain to position the Client-ID within the URL parameters of a link, where the destination domain can access it.
Set up reporting views and add filters
By default, Analytics only includes the page path and page name, not the domains name. as an example, you would possibly see your pages appear within the Site Content report like this:
/about/contactUs.html
/about/contactUs.html
/products/buy.html
Because the domain names aren’t listed, it’d be hard to inform which domain each page belongs to.
To get the domain names to look in your reports you wish to try and do two things:
Create a duplicate of your reporting view that features data from all of your domains in it and add a complicated filter thereto a new view.
The filter will tell Analytics to display domain names in your reports.
Follow this instance to line up a view filter that displays domain names in your reports once you have cross-domain measurement founded.
for a few fields, you would like to pick an item from the dropdown menu. For others, you wish to input the characters here:
Filter Type: Custom filter > Advanced
Field A → Extract A: Hostname = (.*)
Field B → Extract B: Request URI = (.*)
Output To → Constructor: Request URI = $A1$B1
Click Save to form the filter.
You can validate that filters are working as you expect using Google Tag Assistant Recordings. Tag Assistant Recordings can show you exactly how your filters change your traffic.
Add domains to the Referral Exclusion List
When a user journey crosses from your first domain to your second domain, Analytics interprets that because the user having been referred by your first domain to your second domain, and Analytics creates a brand new session. If you wish to be ready to measure one session across multiple domains, you would like to feature your domains on the referral exclusion list.
Check that cross-domain measurement Works
The best thanks to validating that cross-domain measurement is ready up correctly is to use Google Tag Assistant Recordings. once you make a session that crosses domains, it can tell you instantly whether it worked or not.
Here’s an example Tag Assistant Recordings report that shows what it’s like when the cross-domain measurement isn’t set up properly.
For those of you who were about to hit the rear button because you heard advanced and Google Analytics.
We’ve included both an Austin Powers and a Spice Girls meme during this post.
That’s right; we’re making history on Jeffalytics. We are visiting become the primary web analytics article to incorporate regard to the Spice Girls
*! If that does not make this post worth reading in of itself, I’m unsure what does?
* Note: I’ve got no idea if others have mentioned the Spice Girls before in a very web analytics article.
Why would you like to use cross-domain tracking?
To unravel the mystery that’s cross-domain tracking, we want to start with how standard web tracking works.
Standard Google Analytics tracking
Most websites, businesses, and blogs only have to track one domain at a time. The default Google Analytics tracking is set up to treat each domain as a property.
So, using standard Google Analytics tracking:
One domain = 1 Google Analytics property.
User behavior that happens on a website is tracked in Google Analytics using sessions. When a user leaves a website, their session ends.
Cross-domain tracking scenarios
But what if you wish to trace user behavior across quite one domain?
Let’s give some thought to this regarding e-commerce. we can use the Google Merchandise Store (GMS) analytics account as an example.
As you’ll be able to see from the instance below, the GMS is getting plenty of referral traffic from sites that Google owns.
The GMS’s highest converting traffic is coming from gdeals.googleplex.com.
Here’s the potential problem. If these sites are primarily touching on themselves (i.e., self-referrals), they’ll offer you an inaccurate picture in your analytics reports.
It might be better to trace the referring domains within the same analytics property because of the Merchandise store. This way, the first traffic source would get credit for the sale, not the referral between Google properties.
To put it more simply, if we link these domains in Googe Analytics, a user session that starts with a hunt visit landing on gdeals.googleplex.com will continue because the visitor lands on the Google Merchandise Store. So, shopping behavior beginning with one domain will carry over to the subsequent domain in Google Analytics.
Makes sense, right?
Cross-domain tracking for third party shopping carts
Here’s a typical scenario where cross-domain tracking makes sense: E-commerce platforms with third-party shopping carts.
In this situation, users land on the most site to look at a product. When the user goes to test out, they head to a pushcart on a special domain.
Without cross-domain tracking, the shopping behavior and take a look at won’t get linked together. The default Google Analytics settings won’t track conversions across domains. So, these merchants must connect their domains in Google Analytics. Otherwise, the conversion will credit to the third party cart, not the initial traffic source.
Tell Google Analytics what you want
Google Analytics is wise. Very smart! But Google Analytics can’t read your mind.
If you opt you would like to trace quite one website with identical property?
Then you’re visiting should throw Google a friggin’ bone!
Cross-domain tracking isn’t an automatic strategy. there is no easy button for this one.
You are visiting have to map things out so you’ll tell Google Analytics what you would like it to try to do.
What you actually, actually need.
Ok, now that we’ve got both of our dating memes out of the way, as promised, let’s examine the way to founded cross-domain tracking.
Before we will start in Google Tag Manager (GTM), we’d like to grasp the client's IDs.
Using Google Tag Manager to setup cross-domain tracking
For this instance, I’ll use my very own Google Analytics account (I haven’t got access to the code for the GMS account).
To start modifying my cross-domain tracking setup, I want to make a replacement variable in Google Tag Manager (GTM).
I’ll start by choosing the Google Analytics settings variable.
Cookie domains
Once I’m during this variable, you’ll see that I’ve got an “auto” cookie domain.
The “auto” cookie domain is that the standard cookie tracking for all analytics accounts. except for cross-domain tracking, we want to regulate our cookie domain setting.
We need to line our cookie domain to match the most site we are tracking. So, for our example, I’d set my cookie domain, and that I would also set the cookie domains for the domains I’m adding to the present property.
Tracking ID
I also have to match my tracking IDs on my other domains to Jeffalytics.com.
Adjusting these settings will synchronize client IDs across my domains. Syncing the client ID is how we ensure our users’ sessions continue across our linked domains.
The approach will differ supported by whether you’re using hard-coded (i.e. snippet-based) GA or a GTM-based implementation. There are various edge cases to think about, like instances where you’ve got multiple trackers running without delay, or snippet-based and GTM-based running side-by-side. we can’t be exploring those today (although links to appropriate tutorials are provided below). Instead, we’re visiting specialize in a scenario where we’re using standard GTM-based implementations of the fashionable Universal Analytics syntax on both sites.
First, we’ll create a replacement variable of type Constant containing a comma-separated list of the domains which are a part of our cross-domain setup. we are going to use this variable in our Google Analytics Settings Configuration to instruct the Linker Plugin to append the Client ID to any or all links to pages on these domains.
It’s also important to recollect that specifying a site during this list will mean the client ID is appended not just to links thereto hostname, but to its subdomains too. To enable the plugin for a particular subdomain (e.g. myshop.external.co.uk instead of external.co.uk), enter the subdomain during this list instead of the basis domain.
Next, open your Google Analytics Settings variable. make sure that your Cookie Domain is about to auto (see Point D for more on why). Then head to Cross-Domain Tracking, and set the Auto Links Domains field to use your new variable. Then open Fields to line and add a brand new field called allowLinker and set it to true.
Once you’ve tested and published your changes, the Linker Plugin is going to be active and will start appending the Client ID as a parameter to any or all links to pages on the domains laid out in your Auto Link Domains variable.
Thanks, CXL Institute.