Optimize
5.6K members online now
5.6K 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
Highlighted

Text experiment variant not working in preview or live

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

I cannot see a changed text variation neither in preview, nor in live version (I have since removed it from live version as it wasn't generating any test experiments anyway).

I have tried adjusting the text with JavaScript (instead of the "Edit Element" -> "Text" option), but it also does not work. In Edit mode, I can sometimes see the change (when switching the device emulator and exiting/entering Edit mode), sometimes I can't (doesn't matter whether I change the element with JS or via the "Text" option). 
I also tried logging to console from the injected script to ensure it was working, but nothing was logged (might be the intended behaviour to prevent `console.log`, thought, not sure)

I am sure the targeting rules are ok, as this is a copy of a previous experiment (it was a CSS experiment, but on the same page and touching the same element, evaluated after the same event was triggered) which was working just fine.

I have tried the Preview mode in Incognito, I have tried making the experiment active and directing all traffic to the changed variant of the A/B test and then checking the effect in Incognito, but it does not work. 

Optimize is injected via GTM, as is GA.

Is there any reason why this experiment might not work? Am I missing something?
I have 2 live experiments right now which seem to work, the only issue with them is that they getting about 50% fewer sessions than those reported in GA, even though the traffic is set at 100%.

Thanks in advance for any help!

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Luka V
1w

Text experiment variant not working in preview or live

Google Employee
# 8
Google Employee

Hi,

 

The event that is pushed in your page doesn't match the event custom activation event set in the Optimize experiment. In your page, you pushed "optimize.searchResultLoaded" event, but the custom activation event in Optimize is set to ""optimize.comboSearchResultShown". You can change the custom activation event in Optimize to match the event that's pushed in the page.

View solution in original post

Text experiment variant not working in preview or live

Google Employee
# 2
Google Employee

Hi Luka,

 

It's likely that the element you're trying to edit isn't present when the page loads and the element was loaded asynchronously. The element that's modified doesn't not have to be present when the page load for CSS changes, but it must exist for JavaScript or text changes. You can consider to use custom activation event to trigger the experiment after the element you want to change has been loaded.

 

https://support.google.com/optimize/answer/7008840?hl=en

Text experiment variant not working in preview or live

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi,

That is indeed the case, however, I have already set the experiment to be evaluated after a custom event, which is triggered after the ajax content is loaded in the DOM. So I am already doing what you proposed and it doesn't work (hence my confusion).

Text experiment variant not working in preview or live

Google Employee
# 4
Google Employee

Hi Luka,

 

Would you mind sharing your Optimize Container ID and we can take a look?

 

Thanks!

Text experiment variant not working in preview or live

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi, 

Sure, no problem. Is there any way I can share it privately?

Text experiment variant not working in preview or live

Google Employee
# 6
Google Employee

Yes, you can use the feedback tool located in the overflow menu in the top of the Optimize UI to send a feedback.

Text experiment variant not working in preview or live

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Thanks, I sent the feedback Smiley Happy

Marked as Best Answer.
Solution
Accepted by topic author Luka V
1w

Text experiment variant not working in preview or live

Google Employee
# 8
Google Employee

Hi,

 

The event that is pushed in your page doesn't match the event custom activation event set in the Optimize experiment. In your page, you pushed "optimize.searchResultLoaded" event, but the custom activation event in Optimize is set to ""optimize.comboSearchResultShown". You can change the custom activation event in Optimize to match the event that's pushed in the page.

Text experiment variant not working in preview or live

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

Hi,

While I was rubber-ducking this problem in my reply to you, I found out what was wrong. There was an additional condition in my coffee-script which evaulated to "false" when it should have evaluated to "true" - and which was also the reason why the event was not triggered. I was positive the event got triggered.

Thank you for your time and help. 

PS: It might be worthwhile to add a sentence or two in the Troubleshooting about checking via console which events were actually pushed to dataLayer (by evaluating the "dataLayer" window variable via the browser console). I was so positive my event was being triggered that I did not even check the variable Smiley Happy