Google Analytics and Mapped Domains
Hi - I was asked to set up Google Analytics for a mapped domain (josephmurphyblog.org). 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 “josephmurphyblog.commons.gc.cuny.edu” url. Is there an alternate pathway?
#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: https://support.google.com/analytics/answer/1032400?hl=en 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.
#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 https://github.com/cuny-academic-commons/cac/commit/4ab82f5698977a6f1533dc5da49c4f9c5cad8d27.
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.