WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have WP Multisite and now I want to track the different sites.
I'm using Multisite Domain Mapping to map www.mysite.com to http://subsite.mysite.com

My questions is:

a) Do I need to add the same google analytics script to all themes?
b) when creating the script at GA, I have the following choices:

  • A single domain (default)
  • One domain with multiple subdomains
  • Multiple top-level domains

Do I use nr 2 or 3?

I know there are plugins I can use. But I still have to create the scripts at GA, right?

share|improve this question
up vote 4 down vote accepted

Hook the script into the footer, which is easy enough.


As stated in the post, toss that into mu-plugins, it will track all your site, regardless of domain. GA can sort it out on their end.

totally do-able.

share|improve this answer
Hi Andrea. Nice to see you here :) Yup - didn't think of that. Knew it was an easy way to do this. And I bet I'll go for # 3. – Steven Nov 24 '10 at 18:26

You need to find the right setup at GA first. There is an option where you select if you want to use it on a single domain or on multiple domains. Please see the description there as it depends on what you want to do on your site - and you have multiple options.

After you've made your mind about how you want to have it configured you should select the appropriate plugin and configuration. I don't know from top of my head which of the many is fitting for a multi-site multi-domain setup. Probably other readers can share some practical experience for a recommendation.

share|improve this answer

GA operates with profiles, that is entity that you choose to view report for.

Choice between 2 and 3 is essentially choosing if you want to combine all of domains under single profile/report (but be able to distinguish sub-domains with filters and such) or you want completely separate profiles.

See My site has multiple domain names. How do I set up tracking?.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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