Rich-text Reply

optimizely.push("log") is returning undefined

miguelm 12-11-15

optimizely.push("log") is returning undefined

Hi,

 

I am trying to see the Optimizely log, but when I execute optimizely.push("log") in the browser console, is returning "undefined".

 

Any idea why it's not working?

 

Thank you,

 

console-log-undefined.PNG

Level 2

JDahlinANF 12-11-15
 

Re: optimizely.push("log") is returning undefined

1- Verify that optimizely is on the page you are looking at.

2- If it is, try just "optimizely" to make sure it is defined.  If it is not, then there may be an issue with your snippet (I have never seen a corrupted Optimizely snippet, just speaking theoretically).

miguelm 12-11-15
 

Re: optimizely.push("log") is returning undefined

Hi nap0leon

 

thanks for your answer, the optimizely Object exists, but not the push("log").  Maybe is a problem with the quotation mark, because if I paste the code that is shown in the data object guide

 

optimizely.push(“log”) I get a syntax error.  So I try different quotations marks, but no works ("" and '')syntaxError.PNG

 

PD: optimizely object exists

optimizely object.PNG

Level 2

Re: optimizely.push("log") is returning undefined

Hi @miguelm - could you provide the experiment ID and URL on which you're trying to view the log?

Harrison Krat
Solutions Architect | Optimizely, Inc.
harrison@optimizely.com
 
JDahlinANF 12-11-15
 

Re: optimizely.push("log") is returning undefined

[ Edited ]

Your console message has smart-quotes in it

Rather than pasting it in, type it in by hand.

Also, if you click on the word "Object" you can view all of the contents of the optimizely object so as to verify if the .push() method exists or not.

Highlighted
miguelm 12-14-15
 

Re: optimizely.push("log") is returning undefined

Hi  @Harrison_Krat  the url is this one:

 

http://www.nh-hotels.com/booking/step1-rates?fini=30/12/2015&fout=31/12/2015&idioma=com&nadults1=2&n...

 

Experiment ID: Experiment 3874071286

 

 

@nap0leon I also tried to write manually, but I got the same error.

 

Thank you,

Level 2
JDahlinANF 12-14-15
 

Re: optimizely.push("log") is returning undefined

optimizely.push('log') works fine for me:

http://pasteboard.co/1PfBf3o.png

 

on the page, I was placed into the experiment/variation:

"Room Display COM: rewards  message save 5% instead of price - save 5% message"

miguelm 12-14-15
 

Re: optimizely.push("log") is returning undefined

Ouch! I was looking at the "Console" -> "errors" tab instead of "Console -> All" :!

Now I can see the log, thank you @nap0leon
Level 2
JDahlinANF 12-14-15
 

Re: optimizely.push("log") is returning undefined

Doh!  hate it when that happens... I usually get stuck on "cookies" (after clicking the wrong "cookies" tab