Open Bug 1246791 Opened 8 years ago Updated 8 years ago

Log Firefox Channel/DistributionID name for white-listed domains in website analytics via UITour API

Categories

(Websites :: Other, defect)

defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: cmore, Unassigned)

References

Details

The Mozilla UITour [1] gives white-listed domains [2] to allow their web pages to interact with the Firefox browser. This can be used to open menus, highlight specific user experiences, and to read data from Firefox itself to create website content that is more actionable [3]. We also have web analytics wrapped in a DNT condition now to further respect user privacy [4]

While this website to product relationship allows for more advanced experiences, there is something else we can do to understand how our primary websites are assisting with providing a great user experience for our Firefox users.

I propose that we set a Google Analytics Custom Variable [5] that is sets a site-wide variable of the visitor's Firefox channel name to different channels of Firefox (release, beta, aurora, nightly, funnelcake channels) use our websites and how that could impact their retention and engagement with the web experiences.

The custom variable (or dimension) could be set like this:

 _gaq.push(['_setCustomVar',
      XX,                   // This custom var is set to slot #1.  Required parameter and is TBD.
      'Firefox Channel',     // The name acts as a kind of category for the user activity.  Required parameter.
      'release',               // This value of the custom variable.  Required parameter.
      1                    // Sets the scope to visitor-level.
   ]);

Currently, this would only work on www.mozilla.org and support.mozilla.org as those are the two only domains whitelisted in the UITour, but I could see this benefiting the developer.mozilla.org team to understand channels Firefox visitors are using and if we are serving the best content to them.

On www.mozilla.org, we are using this a custom dimension of "Firefox MozTourAPI: Fx Channel", but only at the hit level. 

Let's first discuss how this would be technically done generally within analytics and then we can see how it could be applied to www.mozilla.org, support.mozilla.org and developer.mozilla.org.

[1] http://bedrock.readthedocs.org/en/latest/uitour.html

[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1050080

[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1065525

[4] https://bugzilla.mozilla.org/show_bug.cgi?id=1217896

[5] https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables
:garethc: can you provide feedback on how to do this with GA for say www.mozilla.org and support.mozilla.org?
Flags: needinfo?(garethcull.bugs)
We are already testing this as part of Bug 1246791. Needs info from Gareth whether it's successful.
And I guess this could be implemented in the standalone Update Bar (Bug 1195068) that was previously part of Tabzilla.
(In reply to Kohei Yoshino [:kohei] from comment #2)
> We are already testing this as part of Bug 1246791. Needs info from Gareth
> whether it's successful.

Sorry, I meant Bug 1216225.
(In reply to Kohei Yoshino [:kohei] from comment #4)
> (In reply to Kohei Yoshino [:kohei] from comment #2)
> > We are already testing this as part of Bug 1246791. Needs info from Gareth
> > whether it's successful.
> 
> Sorry, I meant Bug 1216225.

Interesting. Does bug 1216225 allow you to automatically do it across the entire website or only some experiences/pages? This bug is to do it site-wide and it's a generic variable not tied to a specific page experience.
Bug 1216225 is only for specific pages that require a version/channel check, including
https://www.mozilla.org/en-US/firefox/products/
https://www.mozilla.org/en-US/firefox/desktop/
https://www.mozilla.org/en-US/plugincheck/
but excluding
https://www.mozilla.org/en-US/firefox/new/

The Analytics code will be removed from those pages once we make sure the version/channel check is working well. The Update Bar would be the best place to implement this because it's a site-wide feature and SUMO is also using it.
(In reply to Kohei Yoshino [:kohei] from comment #6)
> Bug 1216225 is only for specific pages that require a version/channel check,
> including
> https://www.mozilla.org/en-US/firefox/products/
> https://www.mozilla.org/en-US/firefox/desktop/
> https://www.mozilla.org/en-US/plugincheck/
> but excluding
> https://www.mozilla.org/en-US/firefox/new/
> 
> The Analytics code will be removed from those pages once we make sure the
> version/channel check is working well. The Update Bar would be the best
> place to implement this because it's a site-wide feature and SUMO is also
> using it.

Yeah, we would need this site-wide and not temporarily. The Update Bar would be nice, but it could also be in the base template for any of the websites. Given that only www.mozilla.org and SUMO are white-listed on the UITour API, those are the only sites that it would work now. I think it would also be very useful on MDN too given Firefox Developer Edition.
A blocker for this idea is that we also need to check to see if environment.partner.distributionId is set and if so, set another GA variable.

Like:

_gaq.push(['_setCustomVar',
      XX,                   // This custom var is set to slot #XX.  Required parameter and is TBD.
      'Firefox Channel',     // The name acts as a kind of category for the user activity.  Required parameter.
      'release',               // This value of the custom variable.  Required parameter.
      1                    // Sets the scope to visitor-level.
   ]);

_gaq.push(['_setCustomVar',
      ZZ,                   // This custom var is set to slot #ZZ.  Required parameter and is TBD.
      'Firefox Partner Build',     // The name acts as a kind of category for the user activity.  Required parameter.
      'funnelcake59',               // This value of the custom variable.  Required parameter.
      1                    // Sets the scope to visitor-level.
   ]);

With FHR, the partner build values were in the channel ID and thus all we needed to know was the update channel value. Now, the update channel is only release, beta, aurora, or nightly and the partner value is only within environment.partner.distributionId (when even set).

Need to confirm with MattN if the UITour API can even read the partner ID.
Hi Matt.

Can you estimate the scope of work to have the UITour also be able to read environment.partner.distributionId? The channel name is already available in appinfo.defaultUpdateChannel, but we also need the distributionID, for cohort testing.

https://mxr.mozilla.org/mozilla-central/source/browser/components/uitour/UITour.jsm?rev=7b81b08f1899&mark=1837-1838#1835

https://mxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/TelemetryEnvironment.jsm#1141

Given that that the distributionID is not within the appinfo object, it won't be as simple as adding the field to the array.

The use-case is to have a Mozilla whitelisted website read both the channel and distributionID within Firefox.
Flags: needinfo?(garethcull.bugs) → needinfo?(MattN+bmo)
MattN: it looks like the distributionID was thought about before, but it doesn't look like it was implemented. See your comment here: https://bugzilla.mozilla.org/show_bug.cgi?id=1065525#c7

As we tested locally, it doesn't seem to be in appinfo.distributionID as that was "org.mozilla" and not the partner build ID.
Depends on: 1248678
Summary: Log Firefox Channel name for white-listed domains in website analytics via UITour API → Log Firefox Channel/DistributionID name for white-listed domains in website analytics via UITour API
(In reply to Chris More [:cmore] from comment #9)
> Can you estimate the scope of work to have the UITour also be able to read
> environment.partner.distributionId? The channel name is already available in
> appinfo.defaultUpdateChannel, but we also need the distributionID, for
> cohort testing.

This is very straightforward from the technical side. The information seems readily available in TelemetryEnvironment.currentEnvironment.partner. The main blocker would be getting privacy sign-off from bsmedberg.
Flags: needinfo?(MattN+bmo)
The UITour only provides the channel and version info. See Bug 1070138.
(In reply to Kohei Yoshino [:kohei] from comment #12)
> The UITour only provides the channel and version info. See Bug 1070138.

Yes, that's why :MattN is going to see about extending the abilities of what the UITour exposes to white listed domains and then a website could consume that data.
Depends on: 1249610
The distribution is now exposed from bug 1268369:

> Mozilla.UITour.getConfiguration("appinfo", console.log.bind(console))

>> Object { defaultUpdateChannel: "nightly", version: "49.0a1", distribution: "default", defaultBrowser: true, canSetDefaultBrowserInBackground: false }
Depends on: 1268369
You need to log in before you can comment on or make changes to this bug.