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

Add optional check for experiment cookie to persist previously seen variations (Fixes #93) #100

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

alexgibson
Copy link
Member

@alexgibson alexgibson commented Jul 1, 2024

Whilst traffic cop no longer sets cookies itself, there are circumstances where we might want to ensure a variation is seen again on repeat page visits once a visitor is entered into an experiment (such as a full page redesign).

This PR adds an optional check to read an experiment cookie that can be set by the initiating website. This enables websites to be responsible for handing cookie consent, and provided cookies are accepted, Traffic Cop can then more consistently show the same variation on repeat visits.

Testing:

  1. npm install && npm run build
  2. cd demo && npm install && npm start
  3. Open http://localhost:3030
  • Verify that each of the three demo pages show the same variations on repeat navigations to the base page.

@alexgibson alexgibson force-pushed the variation-cookie branch 2 times, most recently from 6a93aa6 to 95cd170 Compare August 1, 2024 13:20
@stephaniehobson
Copy link
Collaborator

I'm not sure what I'm doing wrong but I'm not able to run the demo locally because it can't find the cookie library:

Screenshot 2025-02-10 at 09 00 39

Copy link
Collaborator

@stephaniehobson stephaniehobson left a comment

Choose a reason for hiding this comment

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

Pull 100! R+ 💯

@stephaniehobson stephaniehobson merged commit c7e5365 into mozmeao:main Feb 11, 2025
1 check passed
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