google-analyticsanalytics.js

multiple domains, how to use the same GA property


I am trying to implement cross domain tracking for two of my domains. While reading the Google Docs on the matter, I got confused by the following paragraph toward the end of the article (bold text):

Both domains need to use the same GA property in order for cross-domain tracking to work correctly. If the sites use different properties, no session information will be shared and cross-domain tracking will not work.

Cross-domain tracking supports multiple trackers, but be aware that they will all share the same Client ID used by the linker.

The scenario I have is:

example.com --> the first domain used to promote my product

domain2.com --> the second domain which is used for secure checkout.

When creating a properly in Analytics, I need to enter the default url. How can I set this up so that I can then use the same property code for both domains?

Can't find any other related questions or articles on this, so I feel I am missing something simple.


Solution

  • It means that you have to use the same UA ID on both sites so that the GA property can collect the data on those 2 sites. You should use GTM to do cross domain tracking since it is much easier to set-up.

    I recommend following the instructions here http://www.lunametrics.com/blog/2015/06/16/cross-domain-tracking-with-google-tag-manager/