Google Analytics with subdomains and data aggregation

I am creating a network of sites that have one primary domain on example.com and several regional sites that use subdomains of the primary, for example:

  • example.com
  • site1.example.com
  • site2.example.com

I have two goals for setting up Google Analytics on this network, but I'm afraid this might be inconsistent depending on how GA works:

  • I want to provide each subregion with its own GA account so that regional site managers can see their statistics, but not other regional sites.

  • I want to be able to aggregate all the data of regional sites with the data of the national site for a review of executive management.

While it’s quite easy to install each of these sites using your own Google Analytics account, I don’t know if this is the right thing to do.

Can I satisfy Goal 1 and Goal 2 with Google Analytics? If so, how can I do it best?

+4
source share
1 answer

One way to do this is if your page code points to the same profile (the same UA-XXXXXXX-X), but sets up individual profiles based on the same profile and uses filters to send data based on subdomains.

This way you do not have to bother with multiple versions of your page code. But you will need to add the following to your page code for all your pages (on all your subdomains) (before calling trackPageview) to track the tracking of all subdomains:

_gaq.push(['_setDomainName', '.example.com']); 

Then you should apply a filter to each profile with:

 Filter Name: site1 traffic (Predefined filter) Filter type (dropdown values): Include only : traffic from the domains : that are equal to Domain: site1.example.com 

Do this for each profile that you have configured for each site X

As for No. 2, you will only have the first profile, which you will deduce from all other profiles (above) as a "global swap" without any filters so that it receives all the traffic.

And you can specify who has access to those profiles in the profile editor.

One bummer: you will need to enter and configure your goals separately in each profile.

+4
source

Source: https://habr.com/ru/post/1348032/


All Articles