adam rowe
adam rowe

Reputation: 446

how to track traffic across n domains with Google Analytics

Example: I have 3 sites, a.com, b.com, and c.com. How can I keep track of the traffic that starts out at a.com and ends up at c.com, using Tag Manager and Universal Analytics?

I know that using referral source is an easy enough thing to view in UA, but I really need referral referral source because UA only uses the most recent referrer, not a referrer n sites back.

Please note that this question is not just about cross-domain tracking, rather keeping track of a site visited before the current referral.

Upvotes: 1

Views: 240

Answers (3)

Using GTM

If you use GTM (Google Tag Manager), you must create a permanent variable that contains the domains where your site might go to or be visited from.

Lets call it "myDomains". It would be like this: myDomains : permanent : "a.com,b.com,c.com" (without quotes)

enter image description here

After this, in your pageViews tags, you'll need to set some fields: In "more configurations", go to "fields to set" add some fields and set the following properties:

Field Name : Value

allowLinker : true

And, if you use multiple sub-domains, add the following:

cookieDomain : auto

enter image description here

Now, still in the "more configurations", under "Cross Domain Tracking", you will use the variable myDomains (that we created before) on the "Auto Link Domains" as this:

{{myDomains}}

Now you just have to save it and now you can track your multiple domains.


Hard-Coded

If You don't use GTM and insert the tags directly to your source code, then what you need is similar to what we did in GTM:

ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['a.com', 'b.com', 'c.com'] );

Note that just like we did in GTM, we:

  • set the cookieDomain (implicitaly with "auto")
  • set the field "allowLinker" true
  • set the "autoLink" to an array of strings, each one containing one of the domains that will send/receive visitors to/from your site.

Note: if you use the same domain but just diferent levels of sub-domains, you will just need to set the cookieDomain to auto, no need for Cross-Domain.


Further reading

Google guide for this implementation

Upvotes: 1

Eike Pierstorff
Eike Pierstorff

Reputation: 32780

I do not fully understand your use case, but you can catch the original referrer, store it somewhere (e.g. in a cookie) and then send it e.g. via the url to the following page. Then you catch the query parameter and use it in a set call:

ga('set', 'referrer', '<original referrer>');
ga('send','pageview');

For all hits following the set call GA will record the referrer as the value of ">" which you replace with your captured value.

Upvotes: 0

GKyle
GKyle

Reputation: 679

There is no real way to do this within the GA interface.

What you could do is create a new GA property that all these websites send data to (if you haven't already done so).

Then create a filter for this property that appends the hostname to the request URI. You can learn to so this here in the Google documentation. This will allow you to see the full URL thus allowing you see all websites.

I would then create two custom dimensions: sessionId and hitTimeStamp. These can deployed through Google Tag Manager. An article by Simo Ahava found here explains well how to do this.

Using SQL, you will be able to partition page by sessionID and order by hitTimeStamp to give you a view on page flow across each website to c.com.

Upvotes: 0

Related Questions