Add new properties to core dataLayer object

RESOLVED FIXED

Status

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: luka.cempre, Assigned: luka.cempre)

Tracking

Production

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36
Here are the properties we'd like to add to the core dataLayer object to be consumed into Google Analytics, in parenthesis are an idea of expected values: 

1. User Logged Into Firefox Account (true/false)
2. Release Version Window (release window number)
3. Firefox MozTourAPI: Accurate Data (true/false)
4. Firefox MozTourAPI: Fx Version (Fx version number)
5. Firefox MozTourAPI: Fx Channel (release, etc.)
6. Firefox MozTourAPI: Fx Up to Date (true/false)
7. Firefox MozTourAPI: Fx is ESR (true/false)
8. Test Pilot User (true/false)
9. Page Type (name of the page group, e.g. Product)
10. Long Scrolling Webpage (true/false)
11. Page has video (true/false)
12. Page has download button (true/false)
13. User Agent (user agent string)
14. Profile Creation Date (date)
Alex,

I could use your help with 1, 2, 8, and 14 specifically. For 1, 8, and 14 it sounds like there might be some API that I can leverage.

For 2, I am not sure exactly how possible this is since it varies on when the start and end date actual is. I'm wondering if there is anything that I could leverage to figure this out without the need to manually update it when the release version changes.
2. Release Version Window (release window number)

AFAIK, we have no API available that gives us data on release windows. It may be possible to get through product details, I'm not too sure. I don't think this is something we currently do / have access to though.

8. Test Pilot User (true/false)

How will you have access to this information? We don't have any API for this currently as far as I'm aware.

14. Profile Creation Date (date)

Ditto, we have no way to get this data publicly.
(In reply to Alex Gibson [:agibson] from comment #3)
> 2. Release Version Window (release window number)
> 
> AFAIK, we have no API available that gives us data on release windows. It
> may be possible to get through product details, I'm not too sure. I don't
> think this is something we currently do / have access to though.

It would be great to be able to have this automatically flow into GA and be able to automatically bucket downloads into a release window instead of manually rolling up timeframes. It would be great to have the release version window of Firefox as a dimension we could plot in GA. We do have this information in a release calendar: https://wiki.mozilla.org/RapidRelease/Calendar

Thoughts?

> 
> 8. Test Pilot User (true/false)
> 
> How will you have access to this information? We don't have any API for this
> currently as far as I'm aware.

I was talking to Cory Price a few weeks back, and I feel like this piece of data is potentially captured somewhere, however not necessarily exposed to pull via an API. Unfortunately, I can't recall the details of this. 

> 
> 14. Profile Creation Date (date)
> 
> Ditto, we have no way to get this data publicly.

I'm aware that we are not capturing profile creation date, however I heard it was requested and could potentially become available in the MozTour API as per bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1256733. What would be required to make this available to us? 

I'd like to be able to understand how long visitors have been with Firefox, by comparing this date to the current date of a user's session. This would be an interesting data point to segment.
(In reply to Gareth Cull [:garethc] from comment #4)
> (In reply to Alex Gibson [:agibson] from comment #3)
> > 2. Release Version Window (release window number)
> > 
> > AFAIK, we have no API available that gives us data on release windows. It
> > may be possible to get through product details, I'm not too sure. I don't
> > think this is something we currently do / have access to though.
> 
> It would be great to be able to have this automatically flow into GA and be
> able to automatically bucket downloads into a release window instead of
> manually rolling up timeframes. It would be great to have the release
> version window of Firefox as a dimension we could plot in GA. We do have
> this information in a release calendar:
> https://wiki.mozilla.org/RapidRelease/Calendar
> 
> Thoughts?

It looks like there is some release data published through product details. I'm not sure what is required to make use of this in bedrock, but perhaps we could use this somehow. Would this get you what you need?

https://svn.mozilla.org/libs/product-details/json/

> > 
> > 8. Test Pilot User (true/false)
> > 
> > How will you have access to this information? We don't have any API for this
> > currently as far as I'm aware.
> 
> I was talking to Cory Price a few weeks back, and I feel like this piece of
> data is potentially captured somewhere, however not necessarily exposed to
> pull via an API. Unfortunately, I can't recall the details of this. 

As far as I know there is no API for this via UITour. You would need to file a bug under Firefox -> Tours I'm guessing.

> > 14. Profile Creation Date (date)
> > 
> > Ditto, we have no way to get this data publicly.
> 
> I'm aware that we are not capturing profile creation date, however I heard
> it was requested and could potentially become available in the MozTour API
> as per bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1256733. What would
> be required to make this available to us? 

Likewise, this is just a Snippets bug discussing the requirement. You would need to file a bug under Firefox -> Tours to make this data available.
(In reply to Alex Gibson [:agibson] from comment #5)

> It looks like there is some release data published through product details.
> I'm not sure what is required to make use of this in bedrock, but perhaps we
> could use this somehow. Would this get you what you need?
> 
> https://svn.mozilla.org/libs/product-details/json/

This could work nicely. 

I'm assuming the following json file is always up to date.
https://svn.mozilla.org/libs/product-details/json/firefox_versions.json

So, when a user visits mozilla.org, we could read the latest version and store those values in their own custom dimension using:
LATEST_FIREFOX_VERSION
FIREFOX_AURORA

Also, now that I'm aware this is available, we could do the same for mobile using this:
https://svn.mozilla.org/libs/product-details/json/mobile_details.json

I believe the above link is for Android...is there one for iOS?


> Likewise, this is just a Snippets bug discussing the requirement. You would
> need to file a bug under Firefox -> Tours to make this data available.

Understood. I'll file a bug. Thanks.
(In reply to Gareth Cull [:garethc] from comment #6)
> (In reply to Alex Gibson [:agibson] from comment #5)
> 
> > It looks like there is some release data published through product details.
> > I'm not sure what is required to make use of this in bedrock, but perhaps we
> > could use this somehow. Would this get you what you need?
> > 
> > https://svn.mozilla.org/libs/product-details/json/
> 
> This could work nicely. 
> 
> I'm assuming the following json file is always up to date.
> https://svn.mozilla.org/libs/product-details/json/firefox_versions.json
> 
> So, when a user visits mozilla.org, we could read the latest version and
> store those values in their own custom dimension using:
> LATEST_FIREFOX_VERSION
> FIREFOX_AURORA

Potentially yes, although I should be clear that we can't query this data source directly. The huge amount of traffic www.mozilla.org generates could possibly kill the source site if we request loading it on every page. We may need to investigate caching it somewhere on bedrock (this will likely require extra work & a dependency bug).
 
> Also, now that I'm aware this is available, we could do the same for mobile
> using this:
> https://svn.mozilla.org/libs/product-details/json/mobile_details.json
> 
> I believe the above link is for Android...is there one for iOS?

I don't believe iOS versions are mad available (yet?), since the only way to download the app is through the App Store.
(In reply to Gareth Cull [:garethc] from comment #4)
> I was talking to Cory Price a few weeks back, and I feel like this piece of
> data is potentially captured somewhere, however not necessarily exposed to
> pull via an API. Unfortunately, I can't recall the details of this. 

I did a bit of digging in the testpilot code and it looks like Cory added a property to `navigator` that is whitelisted on mozorg: https://github.com/mozilla/testpilot/commit/9574d238485902dc70de5fa7b962791660514df5

This means navigator.testpilotAddon returns `true` on www.mozilla.org (or about:home) for anyone with the add-on installed. It returns `undefined` everywhere else.
Hi Alex-

Should we add this one as a task to the sprint board?

Thx,
Jen
(In reply to Jennifer Bertsch [:jbertsch] from comment #9)
> Hi Alex-
> 
> Should we add this one as a task to the sprint board?
> 
> Thx,
> Jen

Hi Jen,

We have a task labelled "Consult & code review for Analytics Pro's" already on the board that's in-progress and has my face on it. I think it's probably ok to include this bug within that task. Thanks.

Updated

2 years ago
Assignee: nobody → james.lorence
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Updated

2 years ago
Depends on: 1275685
Gareth and/or Alex,

Do we still need to be doing the Moz Tour API tracking as a custom event in GA since we're now going to be pulling in that data on every page as Custom Dimension data?
(In reply to James Lorence from comment #11)
> Gareth and/or Alex,
> 
> Do we still need to be doing the Moz Tour API tracking as a custom event in
> GA since we're now going to be pulling in that data on every page as Custom
> Dimension data?

I guess I should ask the same question for the Plugin Details as well since that will also be tracked as Custom Dimension data?
Alex,

Is there a consistent way I can determine is a video is on a page that you know of, or would it be best to keep track of that by just identifying which pages have videos on them manually and keeping a list of those URLs?
Flags: needinfo?(agibson)
I think it's best we discuss these items in a meeting? There are various suggestions I could make, but I'd like to understand the purpose first.
Flags: needinfo?(agibson)
Created attachment 8764202 [details] [review]
GitHub pull request

Attached a link to James' PR for reference.
James I pushed this branch to demo4, can you please test?

https://www-demo4.allizom.org/
Flags: needinfo?(james.lorence)

Comment 17

2 years ago
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/aad93923951bbe0b9ca5c5bbf5761f7863a6cf7b
[bug 1270316] Core DataLayer Additions

https://github.com/mozilla/bedrock/commit/906355287189c5d17297d97a05930f55713c46e3
Merge pull request #4182 from analytics-pros/bug-1270316-core-datalayer-additions

[bug 1270316] Core DataLayer Additions
clearing old needsinfo.
Flags: needinfo?(james.lorence)
closing this as newer bugs have been opened for some of the remaining items that weren't in the initial PR.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.