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: fix tracking of uniqueViewId and previousUniqueViewId in analytics #980

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

boliveira
Copy link

Description

This fixes a problem where if two or more consecutive calls
to analytics.page are added before the microtask queue has an
opportunity to run, the same values for the uniqueViewId
and previousUniqueViewId parameters for both the Omnitracking
events that would be generated. While this works, this is a temporary
fix since there are other values that suffer from the same problem,
for example, the consent and user values can be affected since they
are globally shared. A deeper change to analytics would be needed
to tackle this but as this is not a very common case, we will leave it
like that for now.

Dependencies

Checklist

  • The commit message follows our guidelines
  • Tests for the respective changes have been added
  • The code is commented, particularly in hard-to-understand areas
  • The labels and/or milestones were added

Disclaimer

By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement

@boliveira boliveira added this to the dev-main-23-01-24 milestone Jan 29, 2024
@github-actions github-actions bot added 📦 analytics Relative to the `@farfetch/blackout-analytics` package 📦 react Relative to the `@farfetch/blackout-react` package type: bug Something isn't working properly labels Jan 29, 2024
@boliveira boliveira changed the base branch from main to dev-main-23-01-24 January 30, 2024 14:07
This fixes a problem where if two or more consecutive calls
to analytics.page are added before the microtask queue has an
opportunity to run, the same values for the `uniqueViewId`
and `previousUniqueViewId` parameters for both the Omnitracking
events that would be generated. While this works, this is a temporary
fix since there are other values that suffer from the same problem,
for example, the consent and user values can be affected since they
are globally shared. A deeper change to analytics would be needed
to tackle this but as this is not a very common case, we will leave it
like that for now.
@github-actions github-actions bot added type: bug Something isn't working properly and removed type: bug Something isn't working properly 📦 analytics Relative to the `@farfetch/blackout-analytics` package labels Jan 30, 2024
@boliveira boliveira merged commit c63ba73 into dev-main-23-01-24 Jan 30, 2024
3 checks passed
@boliveira boliveira deleted the fix_analytics_api branch January 30, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 react Relative to the `@farfetch/blackout-react` package type: bug Something isn't working properly
Development

Successfully merging this pull request may close these issues.

4 participants