Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update Matomo initialization #1114

Merged
merged 5 commits into from
Oct 18, 2023
Merged

fix: Update Matomo initialization #1114

merged 5 commits into from
Oct 18, 2023

Conversation

jcbcapps
Copy link
Contributor

@jcbcapps jcbcapps commented Oct 5, 2023

SC-2582

Proposed changes

This PR

  • Changes the setDoNotTrack option in Matomo's initialization to false
  • Move the calls to trackRank and trackBaseLocation into a useEffect

Reviewer notes

Setup

Start the system

yarn services:up
yarn dev
cd ../ussf-portal-cms
yarn dev

Login to the portal http://localhost:3000

Start storybook

yarn storybook

Login to storybook http://localhost:6006, though the command above should open it for you


Code review steps

As the original developer, I have

  • Met the acceptance criteria
  • Created new stories in Storybook if applicable
  • Created/modified automated unit tests in Jest
  • Created/modified automated E2E tests
  • Followed guidelines for zero-downtime deploys, if applicable
  • Use ANDI to check for basic a11y issues

As a reviewer, I have

Check out our How to review a pull request document.


Screenshots

@jcbcapps jcbcapps requested a review from a team as a code owner October 5, 2023 20:15
@@ -416,7 +416,7 @@ describe('Analytics context', () => {
'setDocumentTitle',
'Test Doc Title',
])
expect(windowWithAnalytics._paq[1]).toEqual(['setDoNotTrack', true])
expect(windowWithAnalytics._paq[1]).toEqual(['setDoNotTrack', false])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about this during one of our meetings and decided it should be a launch darkly flag. Suggestion is to name it MatomoClientSideDoNotTrack and have it return true or false to be set here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After initial investigation this wasn't working, not sure that LD is initialized early enough for it two work. So we decided to just leave it as is for now so we can confirm it allows us to track rank and location properly.

@jcbcapps jcbcapps changed the title refactor: Update Matomo initialization fix: Update Matomo initialization Oct 18, 2023
@@ -416,7 +416,7 @@ describe('Analytics context', () => {
'setDocumentTitle',
'Test Doc Title',
])
expect(windowWithAnalytics._paq[1]).toEqual(['setDoNotTrack', true])
expect(windowWithAnalytics._paq[1]).toEqual(['setDoNotTrack', false])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After initial investigation this wasn't working, not sure that LD is initialized early enough for it two work. So we decided to just leave it as is for now so we can confirm it allows us to track rank and location properly.

@mergify mergify bot merged commit f6acf28 into main Oct 18, 2023
@mergify mergify bot deleted the jc/adjust-matomo-tracking branch October 18, 2023 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants