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

Experiment toggling is not sticky between different .js files on the same pageview #10739

Closed
tlong2 opened this issue Aug 1, 2017 · 2 comments

Comments

@tlong2
Copy link
Contributor

tlong2 commented Aug 1, 2017

Currently the experiment toggles are "cached" using a global variable defined at the file level: https://github.com/ampproject/amphtml/blob/master/src/experiments.js#L44. This means that for experiments using a simple traffic fraction, toggles determined in amp.js would not be correlated with an experiment toggle determined in amp-ad.js (for example).

The toggles should be cached on a window property so that they are synchronized across all .js files on a given pageview.

@tlong2
Copy link
Contributor Author

tlong2 commented Aug 1, 2017

Just to clarify that by ".js file" here I mean a final compiled .js binary that is loaded by a page (not every .js file in the source code).

@lannka
Copy link
Contributor

lannka commented Aug 1, 2017

This is a known issue: #8970

You can make the toggles global for now to fix your problem. We have a plan to make it a service.

Let's close this and track over there.

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

No branches or pull requests

2 participants