I need to be able to track revenue from the most frequent routes between multiple hostnames (let's call them foo.domain.tld and bar.domain.tld) in my google analytics account. For example, if someone is at foo.domain.tld/event and then travels to bar.domain.tld/purchase-ticket and buys a ticket, I'd like to be able to associate the revenue from that ticket back to foo.domain.tld/event.

Is there any good way for me to do this? I have a content grouping set up where pages from each domain are placed in separate groups, but this does not seem to help at all. It seems like the only way I could possibly do this is to remove foo.domain.tld from my Referral Exclusion List so that these become self-referrals and then use the "Referral Path" dimension to track ecommerce events. This approach is clearly not optimal.

1 Answer 1


There are two logical ways you can do this but, given the wording of your question, it appears as though you want to treat these subdomains as two different entities entirely. The most beneficial way to do this is to set up three different properties, one for foo.domain.tld, one for bar.domain.tld and one for both. In this scenario, you would modify the tracking script to utilize Google Analytics' Linker plugin (API), which will allow you to track across domains and subdomains. For example, set the following on the foo.domain.tld tracking script:

// foo.domain.tld property
ga('create', 'UA-XXXXX-X', 'auto');
// shared property
ga('create', 'UA-XXXXX-Z', 'auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', ['bar.domain.tld'] );

Now set the following on the bar.domain.tld tracking script:

// bar.domain.tld property
ga('create', 'UA-XXXXX-Y', 'auto');
// shared property
ga('create', 'UA-XXXXX-Z', 'auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', ['foo.domain.tld'] );

This setup allows for the passing of data between subdomains and provides specific views for each subdomain, as well as an aggregated view for both. This approach should help you better associate the revenue from bar.domain.tld/purchase-ticket with foo.domain.tld/event.

  • Thanks! do you know how I could do this if I wanted them to be within the same property? Commented Nov 9, 2015 at 15:28
  • If you wanted to use the same property, you would just use the standard tracking script instead and prepend the hostname to the request URI. This can be done a couple of ways but the easiest way is through a filter. Moz has a great article here on how to do this. You still want to ignore self-referrals, however, because otherwise you're going to get mismatching data, such as multiple sessions when someone moves from foo.domain.tld to bar.domain.tld.
    – nburr
    Commented Nov 9, 2015 at 19:12
  • Thanks! I'd upvote you but I don't have enough reputation Commented Nov 9, 2015 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.