nuxt-community / google-optimize-module

SSR friendly Google Optimize module for Nuxt.js
MIT License
215 stars 32 forks source link

Forcing the "test" experience #47

Open t1mwillis opened 3 years ago

t1mwillis commented 3 years ago

Is there any way, for testing purposes, to force viewing the "test" experience, aside from simply setting the weight to 100? I ask because it can be helpful for QA purposes to verify expected functionality between test and control. It seems like manually modifying the cookie is another option, but I would prefer something like ?testName=enabled as a query param. If this is outside of the scope of the module, simply let me know.

farzadso commented 3 years ago

Why not set the weights accordingly based on the current environment you're in? e.g., using environment variables, etc.

I think this is kind of outside the scope. What do you think @hecktarzuli @pi0 ?

t1mwillis commented 3 years ago

@farzadso Can you provide some more insight on how I might go about setting those environment variables? Do the experiments receive the context as an argument? Or are you simply talking about referencing process.env.TEST_A_WEIGHT within the experiments. The latter will not work as we build the application once using docker, then inject various environment specific variables.

Passing the context as an argument could be beneficial in that it would allow for different test id's within environments as well.

farzadso commented 3 years ago

@t1mwillis I meant the latter and since you're using the same built image you can't achieve what I meant.

If your test environments have a specific URL structure, a hacky version would be to set the conditions based on the different URLs.