Feature #3478

Google Analytics and Mapped Domains

Added by scott voth almost 8 years ago. Updated over 7 years ago.

Priority name:
Category name:
Domain Mapping
Target version:
Start date:
Due date:
% Done:


Estimated time:


Hi - I was asked to set up Google Analytics for a mapped domain ( I wasn’t sure it would work – but set it up anyway – and it doesn’t appear to be working. Am I right that this is not possible? Or is there a way to do it? I tried with the “” url. Is there an alternate pathway?


#1 Updated by Boone Gorges almost 8 years ago

Scott - I don't know much about this, but I would guess that you'd need to use the mapped domain rather than the domain. Can you try that?

#2 Updated by scott voth almost 8 years ago

Hi - I tried that and a number of other ways, but nothing seems to work. Just wondering what we should tell the member about this.

#3 Updated by Boone Gorges almost 8 years ago

Hm. Do we have a Google Analytics plugin that would allow the user to enter a code that he set up for his own account? I have a feeling that's what'll be necessary.

#4 Updated by scott voth almost 8 years ago

There isn't one currently - I see there is a plugin called WP Google Analytics that seems to do the trick - but is there a problem with other, non-mapped sites installing it, since we have GA running sitewide?

#5 Updated by Boone Gorges almost 8 years ago

  • Tracker changed from Support to Feature
  • Status changed from New to Assigned
  • Assignee changed from Boone Gorges to Daniel Jones
  • Target version set to 1.8

Thanks for looking, Scott. Google suggests that it should be possible to have more than one: But this is going to take some investigation by our team - we have to make sure that the plugin we adopt will use the correct syntax. I'm going to put this into the 1.8 for more examination. Please let the requester know that we don't currently support this feature, but we plan to adopt it in the future.

Dan - Can I ask you to follow the Google support link above, and then compare the plugin that Scott mentions with the Google Analytics code that we're currently using, and make some recommendations about what (if anything) needs to be done to make this work on the Commons?

#6 Updated by Daniel Jones over 7 years ago

So it looks like our current site-wide GA is using Google's analytics.js, which supports multiple tracking codes. The plugin that Scott found looks like it uses Google's ga.js, which only supports one code. However, you can have one ga.js code and multiple analytics.js codes, so it looks like as long as the only GA codes being added are through our site-wide implementation (which I found in plugins/bp-custom.php - is that right?) and the WP Google Analytics plugin, there shouldn't be any conflict. Or even if people added another GA code using analytics.js it'd be fine. Only problem would be if someone added another code via ga.js, but that wouldn't conflict with out site-wide tracking, just the other tracking that they had added. Does that all make sense? Seems like it'd be fine to add this plugin to me.

#7 Updated by Matt Gold over 7 years ago

  • Assignee changed from Daniel Jones to Boone Gorges

Thanks, Dan. Reassigning to Boone.

#8 Updated by Boone Gorges over 7 years ago

  • Assignee changed from Boone Gorges to scott voth
  • Target version changed from 1.8 to 1.7.2

Thanks, Dan. This sounds about right. I've added the plugin in

Scott, I'm going to include this ticket in tomorrow's release. I'll update here when the release is live, and then I'll ask you to test on one of your Commons sites before closing the ticket out. Thanks.

#9 Updated by Boone Gorges over 7 years ago

  • Status changed from Assigned to Resolved

Hi Scott - The release is now live. I'm going to mark the ticket as resolved since the plugin is now available on the server, but I would like to ask you to do a bit of testing to make sure that it's possible to activate a separate analytics account. If you find that there are problems, feel free to reopen with details.

#10 Updated by scott voth over 7 years ago

I used the plugin on one of my test sites on the Commons, and set it up on my own Google Analytics property, added a filter and it is working fine. Thanks. I will inform the member that this is an available option.

Also available in: Atom PDF