Closed Bug 854445 Opened 11 years ago Closed 11 years ago

Configure Google Analytics to track multiple domains for webmaker

Categories

(Websites :: Web Analytics, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kylerrush, Assigned: cmore)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22

Steps to reproduce:

Currently popcorn.webmaker.org, thimble.webmaker.org and webmaker.org websites have separate Google Analytics accounts which prevents us from combining the data between the two domains to see things like navigation summaries (when a user lands on webmaker.org and navigates to popcorn.webmaker.org).

The steps to do this are listed here: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite

The relevant part for this bug is: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite#profilesKey

Here is what is specifically needed: 

1.) Ensure that the webmaker.org profile in the webmaker.org account is setup without any filters to serve as the "master" profile.

2.) Create a new profile called "All domains" in the webmaker.org account that will be used to track data across all domain. This is necessary because by default GA does not show the host name. This profile must be configured to show the host name in the content report. Steps:

- In the Profile Settings page, click the Add Filter link.
- Choose Add New Filter and provide the filter a name.
- Choose Custom Filter and select Advanced on the Filter type settings.
- Under Advanced settings:
  + FieldA should be set to Hostname
  + FieldB should be set to Request URI
- Set the values for both Field A and Field B to (.*), which is an expression that captures all characters.
- Set the Output To --> Constructor option to Request URI and provide $A1$B1 as the value for that choice.

Once this is done we can change the GA snippet on each of the domains to use the same GA account without losing any data.
Status: UNCONFIRMED → NEW
Ever confirmed: true
This is pretty straight forward and how I implemented it before for websites that are closely related. I will have our new Web Analytics Engineer get on this soon. The only downside to this method is that you have to use advanced segments to filter down to specific websites, but that is not too difficult.
Assignee: nobody → chrismore.bugzilla
Assignee: chrismore.bugzilla → garethcull.bugs
Assignee: garethcull.bugs → chrismore.bugzilla
Summary: Configure Google Analytics to track multiple domains → Configure Google Analytics to track multiple domains for webmaker
Hi everyone.

We have an easy solution to this. For all subdomains of webmaker.org including the main webmaker.org website, please use the following code:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35433268-12']);
  _gaq.push(['_setDomainName', 'webmaker.org']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

The code is the same with what you have now except that it include the setDomainName tag and a different UA string. Please update the GA tag on all three websites to use this tag. 

I just adjusted the hostname filter to include all traffic with domains that end with webmaker.org. Once all the websites are using the same tag above, you can look at the traffic combined or create advanced segments to filter down to specific subdomain. I can help you with that once you have all of the sites switched over.
Hi Chris,

We have already added the _setDomainName line, but we didn't want to update the UA string until the hostname filter was added or else we'd lose traffic. Now that the hostname filter is in place we will update the UA strings. Thanks!
I'd also like to be able to track popcorn.webmadecontent.org - this is the domain that our apps publish users content to.

Kyle/Chris, anything we'd have to modify for this?
(In reply to Brett Gaylor from comment #4)
> I'd also like to be able to track popcorn.webmadecontent.org - this is the
> domain that our apps publish users content to.
> 
> Kyle/Chris, anything we'd have to modify for this?

Ok, so you are fine with popcorn.webmadecontent.org being mixed in with the webmaker.org content and having to use advanced segments to filter traffic down to this specific sub-domain? I can add .*(webmaker|webmadecontent)\.org as the hostname filter.
Update! We may not be able to make this change to the webmaker family of websites. "Do Not Track" recommendations say that Web Analytics must:

* Have an opt-out for 3rd part use (check!)
* Use first party cookies (check!)
* Have data in silos by domain so that a user cannot be tracked across different websites). (Fail!)

Making this change would fail the 3rd check and make Do Not Track exceptions to be invalided for the webmaker.org websites.
:cmore - just looking for a bit of extra clarity on this.

Is the problem with all the sub-domains or just the .webmadecontent one?
(In reply to Ross Bruniges [:boozeniges] from comment #7)
> :cmore - just looking for a bit of extra clarity on this.
> 
> Is the problem with all the sub-domains or just the .webmadecontent one?

Any sub domain on any website. DNT also applies to Web Analytics and there is an exception on analytics *if* the criteria in comment 6 is met. GA sets first party cookies, we have opt-ed out of data, but if we start putting the same GA tag on multiple websites it is clearly against DNT. DNT specifies that analytic tag has to be segmented out per-website and per-domain name. We are waiting for Alex Fowler to confirm that even this exception will be suffice for DNT. The only other option is to have a conditional statement around all GA tags to determine if DNT is enabled. I am trying to avoid the idea of eliminating GA when DNT is enabled due to it being critical for all of us to improve the websites for our users.
:cmore -- that recommendation doesn't feel right in the context of the webmaker family of sites.  FYI, I'm going to try and track down alex and sid and explain the setup we have, and see if they agree.

If you already have a thread going w/ alex, please loop me in?
(In reply to David Ascher (:davida) from comment #9)
> :cmore -- that recommendation doesn't feel right in the context of the
> webmaker family of sites.  FYI, I'm going to try and track down alex and sid
> and explain the setup we have, and see if they agree.
> 
> If you already have a thread going w/ alex, please loop me in?

Let's first get Alex to reply to bug 858839 first as that is a pressing issue and need to get clarification here. I've already personally talked to Sid about the silo by domain point generally, but not specifically about webmaker.
I spoke with Alex yesterday, and I think it's best to have him weigh in specifically on this bug as well. There may be an interim option, with potential remediation later. (adding Alex as CC)
(In reply to Ryan Merkley from comment #11)
> I spoke with Alex yesterday, and I think it's best to have him weigh in
> specifically on this bug as well. There may be an interim option, with
> potential remediation later. (adding Alex as CC)

Yeah, we also need him to weigh in on bug 858839 too as it is completely related. We need DNT guidance in regards to Google Analytics.
Hi folks - could we get an update on this? Alex have you had a chance to look at these?

@Chris More - we swapped in our Google Analytics code with the one suggested in early April on popcorn.webmaker.org, but held off on the other domains once these issues came up.

Have we actually been gathering these analytics on popcorn.webmaker.org?  Should we switch back to our old GA code while this is being sorted out?  Please advise.
There is no clear policy or rule of thumb on this, yet. Sorry.

The current discussion outside of Mozilla is that DNT is about third party tracking and not related to first parties. We are the first party for all our sites and subdomains. We don't have to follow this approach, but at this point we have not had that discussion internally.

The point I made on the other bug is that today our users expect that DNT applies to any tracking, mostly because we don't provide any additional information about what it means and that it's only focused on addressing third party tracking. Depending on how the W3C work pans out, I would expect that we'll want to consider updating our settings to ensure the words are accurate in what happens when a user turns on DNT.

We are free to make whatever determinations we want for our sites, including how we want to implement analytics and support for DNT. For instance, we could pilot an implementation that respects DNT for GA on our webmaker family of sites and see how it plays out, especially if that is a better fit with user expectations and the messages we want to portray on these sites.

Happy to discuss more, especially if I'm missing something here.
(In reply to Alex Fowler from comment #14)
> There is no clear policy or rule of thumb on this, yet. Sorry.
> 
> The current discussion outside of Mozilla is that DNT is about third party
> tracking and not related to first parties. We are the first party for all
> our sites and subdomains. We don't have to follow this approach, but at this
> point we have not had that discussion internally.
> 
> The point I made on the other bug is that today our users expect that DNT
> applies to any tracking, mostly because we don't provide any additional
> information about what it means and that it's only focused on addressing
> third party tracking. Depending on how the W3C work pans out, I would expect
> that we'll want to consider updating our settings to ensure the words are
> accurate in what happens when a user turns on DNT.
> 
> We are free to make whatever determinations we want for our sites, including
> how we want to implement analytics and support for DNT. For instance, we
> could pilot an implementation that respects DNT for GA on our webmaker
> family of sites and see how it plays out, especially if that is a better fit
> with user expectations and the messages we want to portray on these sites.
> 
> Happy to discuss more, especially if I'm missing something here.

Thanks for the input, Alex!

Brett/Ryan: It looks like we are free to move forward with where DNT and Mozilla is currently at. We can use the same tag from comment 2 across all of the websites. Once it is set up on all of the websites, I can verify it is working right.
Great, Alex - thank you.

Chris - we have this set up for popcorn.webmaker.org and webmaker.org - I'm keen to see if we can configure our google analytics panel based on this being in place.

As mentioned, I don't have any statistics since April at my disposal, could you enlighten me if there are ways I can access what we've collected since then?
Flags: needinfo?(chrismore.bugzilla)
(In reply to Brett Gaylor from comment #16)
> Great, Alex - thank you.
> 
> Chris - we have this set up for popcorn.webmaker.org and webmaker.org - I'm
> keen to see if we can configure our google analytics panel based on this
> being in place.
> 
> As mentioned, I don't have any statistics since April at my disposal, could
> you enlighten me if there are ways I can access what we've collected since
> then?

I'm emailing you a report that shows main webmaker.org traffic vs popcorn.webmaker.org traffic in one report. You have to create an advanced segment to filter down the traffic to both hostnames.

Popcorn.webmaker.org segment, hostname matches exactly popcorn.webmaker.org

Webmaker.org segment, hostname matching regex ^(www\.)*webmaker\.org$ (I had to use a regex because the webmaker.org website is accessible with and without a www and that is also bad for SEO)

Are you able to log into GA? You have access to it all and I see your account. Just make sure you are logging into it with brett@mozillafoundation.org.
Flags: needinfo?(chrismore.bugzilla)
Where are we at with this? Do we want to proceed or should we keep it how it was originally set up?
Ping.
Chris,

I was helping with getting GA on webmaker for the new launch in a separate bug filed under Webmaker. The snippet is on all webmaker sites.

https://bugzilla.mozilla.org/show_bug.cgi?id=884175

Should we close this bug now?
I think there is still an open question if a single tag is still what they want given the reporting. Brett, can we make a final decision?
Flags: needinfo?(brett)
Chris, apoligies.  Mike Beltzner has been assisting with metrics - Mike, is this good to close?
Flags: needinfo?(mbeltzner)
(In reply to Brett Gaylor [:brett] from comment #22)
> Chris, apoligies.  Mike Beltzner has been assisting with metrics - Mike, is
> this good to close?

I think we are good to go here especially after adding the regex to also track makes.org. I will close and if anyone has an issue, they can reopen. :)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Flags: needinfo?(mbeltzner)
Flags: needinfo?(brett)
You need to log in before you can comment on or make changes to this bug.