Optimize
4.1K members online now
4.1K members online now
Learn how to create your first experiment and get tips on creating A/B, redirect, and multivariate tests.
Guide Me
star_border
Reply

Problem with Edit Mode and Preview Mode

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hey guys, I tried an experiment in Google Optimize in the Editor mode and all went fine. But, after saving changes and visualizing in the web preview mode, the changes weren’t saved and the variable was the same as in the original version.

This issue repeated it self in two of my experiments already.

Has this happened to anyone else? Any suggestions on how to solve this?

Thanks!
😀

1 Expert replyverified_user

Problem with Edit Mode and Preview Mode

Google Employee
# 2
Google Employee

Have you look at the "Diagnostic" messages in the top bar of the Editor?

 

A common issue may be, that your page contains javascript code that modifies it, after it initially loads.

 

In that case the elements for the CSS selectors that are used by the editor, may not exist, or may not correspond to the correct ones, at the time that the Optimize runtime runs (during "web preview" and eventually for end-users).

 

The solution in that case, will be to use custom activation and trigger changes, after your page has "stabilized".

 

See here for more details.

 

 

Problem with Edit Mode and Preview Mode

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

I looked at the "diagnosis" messages and I do not have anything.

I changed 1 text in the site, put the traffic in 99,9% for this variation and with test on air, happened the same.

Edit mode is ok, preview mode and test on air dont ok =(

Problem with Edit Mode and Preview Mode

Google Employee
# 4
Google Employee

Hi, would it be possible to share the page URL (if it is public) or the Optimize container ID?

Problem with Edit Mode and Preview Mode

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Of course =)

the url is http://www.pedidadehoje.com.br/fortaleza

And the container id is GTM-NQ9NV9Z

 

Thanks Dimitris

Problem with Edit Mode and Preview Mode

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Hi I have the same issue did you find the solution ?

Problem with Edit Mode and Preview Mode

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

I'm having the same problem. Having used optimize in previous months with no problems. For the past week we have had trouble getting experiments to work outside of the edit mode in optimize - no errors in the diagnostics or and tag manager is present on the page (the way we add optimize).

Problem with Edit Mode and Preview Mode

Google Employee
# 8
Google Employee

Hi and sorry for not replying earlier.

 

Is this an experiment where you are adding a javascript change? Are you using jQuery in that javascript?

 

A common problem is to expect that you can use jQuery inside a javascript change, without having that library in your page (or defining it below the optimize snippet - so its not available when that code runs). This is because some other A/B testing tools include some version of jQuery. Things will seem to work OK in the editor, because the editor loads the changes after the page (and all its libraries) have been loaded.

 

Google Optimize doesn't depend or include jQuery, to ensure that it is as lightweight and fast as possible, and leave up to site owners decisions about libraries.

 

Very often you don't need to include jQuery if the javascript is really simple - there is equivalent plain javascript that achieves the same (without the need to download a separate library). Also, if possible consider using an available "change type", supported by "Google Optimize" out of the box (i.e. attribute change, text change etc). You can use the "Select Elements" dialog (top-left of editor header).

 

Finally, if you really need (or want) to use jQuery, just include it on your page above the optimize snippet, see:

https://support.google.com/360suite/optimize/answer/6262084?hl=en

This will perform a lot better than if it was bundled inside Optimize since, because jQuery will be cached a lot better.

 

A second thing that you need to be careful with javascript changes: Ensure that the selector of the element where you attach the javascript change, includes all the elements that you want to modify.

 

This javascript will not run on DOM ready, but as soon as that "selector element" has been parsed by the browser. So if your code tries to modify an element that is below in the page, that element may not exist yet.

 

Have in mind, that the javascript change will make sure that this "selector element" remains hidden until your code runs so that you will not have an flicker.

 

Hope this helped.

 

Problem with Edit Mode and Preview Mode

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

Hi Dimitris D,

 

I am having same problem. Experiment running fine in edit but not in actual live site.

This is my first experiment, so not that confident and sure what and where to fix.

Can you please help me with that?

Problem with Edit Mode and Preview Mode

Google Employee
# 10
Google Employee

Hi

 

Can you share your page Url, or you Optimize container Id?