-
Notifications
You must be signed in to change notification settings - Fork 23
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
Only the id="0" Variant component is rendered. #122
Comments
Hey @casamia918, Its been some time since I last used this library, but can you share more how you are testing the snippet of code? I remember that in order to run it locally you cannot use localhost for the domain, something related with the cookies used by google optimize. Maybe this stack overflow answer can help you: https://stackoverflow.com/a/56635677/13470154 |
I'm not using localhost in my domain name, but using ip address. I've inserted google optimize snippet code at top of the index.html file, as same as the official optimize doc says. My a/b test is working. But in your library code, only the Variant id="0" component is rendered. At last, I've removed your library code and just inserted only the google optimize snippet code, but the a/b test is still working properly. Now, my new question is, why should I use this library to apply google optimize? I'm confused. |
I see, but I would still recommend to use a custom domain name when testing. You could modify your
You definitely don't need this library to use google optimize, I created it because I had a use case where I needed custom react components to show according the google optimize experiment and I couldn't get it without using the js api of google optimize. This library just abstract that away. |
Oh, I see. Thanks |
I ran into this same issue when I was previewing on Google Optimize -- it would only show Variant 0 After I ran the "debug" preview page there was URL match error as I the page targeting I had specified didn't match my dev url. Removing the page targeting rule on Google Optimize allowed me to view all the variants. I added this back before starting the experiment. |
I've installed this library and used exactly as same as example code.
My app is rendering A/B test properly, as my Google optimize experiment setup.
But, when I insert simple test code like above image to check which variant component is rendered, it always rendering variant with id="0".
I think only the id="0" Variant component is rendered. But I can't understand why this happens.
I read the component source code, but it looks have no problem.
The text was updated successfully, but these errors were encountered: