Docs-website: Enable anonymous tracking on the Docs Site Analytics

Created on 15 Mar 2021  路  11Comments  路  Source: newrelic/docs-website

Related Issue #1176

Issue

both Docs Site Traffic and JP site traffic have dropped significantly since the launch of our new Docs Site. This is causing confusing as it's a large drop in overall traffic being reported in GA.

Assessment

After talking through it, we believe the decrease in page views is related to the new GDPR cookie acceptance process a user goes through when they first visit the site. Given many users already accepted the cookie for the old process (Intercom) when visiting the new site they need to accept these cookies again. Looking at NR browser data, for the same time period there is a similar pattern that may prove this assumption correct. So we'd like to enable anonymous tracking in GA to capture analytics data from users who haven't yet accepted a cookie for the site or who choose not accept the cookie.

Approach

Recap:

  1. (Clicks NO) IF a user doesn't accept cookies, Tessen will not be used to send data to Segment, but we'll be able to send anonymized data to GA directly.
  2. (Never Clicks YES / NO) IF a user doesn't accept cookies, Tessen will not be used to send data to Segment, but we'll be able to send anonymized data to GA directly.
  1. (Clicks YES) IF a user accept accept cookies, Tessen will e used to send data to Segment.
    docs_staging segment source destinations will anonymize IP addresses when sending to google analytics And we will be excluding IP addresses from data sent to Snowflake.

Acceptance Criteria

  • [x] Check in with legal if anonymous tracking violates any GDPR rules.
  • [x] Look into anonymous data tracking in GA as well so we can anonymized analytics for page views and sessions in GA and NR Browser for those users that don't accept cookies.
  • [ ] enable anonymous tracking feature in GA
  • [ ] data should be collected anonymously in GA and NR Browser correctly
  • [ ] update our analytics WIKI(https://github.com/newrelic/docs-website/wiki/Event-Data--and--Instrumentation) to account for these changes
analytics blocked eng enhancement gatsbysites 3

All 11 comments

Would it be worth instrumenting the cookie banner to see how many are accepting/denying the cookie consent? That might also help us determine whats causing the dip.

@jerelmiller i think that's a good idea.

It's worth ruling in/out the cookie consent thing - but my gut is that most people are conditioned to clicking on the cookie consent thing - as trying to use any site requires it.

What's different since moving to the new Docs site is that we go through Segment.IO, which then passes on to GA. Thus one easy experiment is to temporarily disable Segment, and substitute in the GA code directly (still using the right tracker ID). You'll see within an hour if that makes a difference or not. If it does...then you know it's something going on at the Segment level.

@jpvajda @zstix @austin-schaefer

Love that idea @tariqahmed !

I've begun asking for input into doing this from internal teams to ensure we don't violate GDPR

An update on where we are on this.

Tessen and anonymous tracking

Tessen sends NR User ID and IP address to Segment, if available. I will ask tessen eng / test if not calling tessen.identify() and setting segment option identifiable to false prevents that. Worth noting that once it's in Segment, you can exclude that info in each destination (Snowflake, Google Analytics).

docs_staging database

I let Zoe know that the only source the docs site reports to is Docs (All Env) (recently renamed to Docs.Newrelic.Com (PROD)). The underlying name for that source is docs_staging (which is also the database name you query against in periscope). She is going to look into querying that for the data she's looking for.

OSS and dev segment sources

OSS and developer sites are going to report to each their own source.

  • developer: nr_oss_dev_staging
  • opensource: nr_oss_dev_production

env not reporting

I noticed that the theme is setup to read the env and report that (like it did in Drupal) so we can distinguish prod, dev, local env records in segment and beyond (since the sites only report to one source for any env it's running in). Filed issue for that: https://github.com/newrelic/gatsby-theme-newrelic/issues/339

FWIW. i have a branch that adds the google analytics code by itself (with anonymize IP option set to true) if a user declines the cookie consent. seems to work so far. it would still need a bit of refactor to more closely follow the pattern that tessen uses

@roadlittledawn can you elaborate on the refactor a bit? I'm just curious what that work is and if we need to create a ticket for that work.

@roadlittledawn how difficult would it be to enable this anon tracking on our Dev and OSS sites, now that they are hooked into Segment and send data through the analytics pipeline I'm thinking it would make sense to enable this on those sites as well.

question to answer

Does tessen have something we need to set to NOT send IP data to Segment.
IF NO, does it matter to GDPR if IP data is in Segment?
IF YES, what are we supposed to?

There is going to be a dicussion on Tues 4/13 about this question with a few folks in legal, so I'm putting blocked label on it, as I don't think we can move forward with finishing this work until we have that discussion.

Was this page helpful?
0 / 5 - 0 ratings