Rich-text Reply

How to add Crazy Egg snapshot code

lewwwin 11-04-14

How to add Crazy Egg snapshot code

Hi,

 

How to add to Optimizely snapshot code for Crazy Eggcode? 

 

Example:

 

<!— Track a specific Crazy Egg snapshot by name —>
<script type="text/javascript">
    var CE_SNAPSHOT_NAME = "Optimizely DoladujTelefon.pl : KROK 1 CR: Original";
</script>

 

 

Level 2

Re: How to add Crazy Egg snapshot code

Hi @lewwwin,

 

Can you confirm you're looking to bring this JavaScript code in as part of Optimizely variation code?  If so, this Knowledge Base article provides an example approach to including external scripts into your experiments.

 

If this is not what you are looking to do, could you provide a bit more details on what you're trying to achieve?

Harrison Krat
Solutions Architect | Optimizely, Inc.
harrison@optimizely.com
 
lewwwin 11-04-14
 

Re: How to add Crazy Egg snapshot code

Hi @Harrison_Krat 

 

i'm not a best with coding with JS. Could you help me with this particular example? Smiley Happy 

Level 2

Re: How to add Crazy Egg snapshot code

Hi @lewwwin,

 

It may actually be easier for you to use our out-of-the-box CrazyEgg integration.  Please refer to this Knowledge Base article.  When you apply your API credentials and ensure that CrazyEgg is already running on your site, Optimizely will automatically append the experiment name and variation name (i.e. what CrazyEgg calls a snapshot name) to your CrazyEgg data and allow you to view those reports inside CrazyEgg.  In this way you can avoid writing any new JavaScript code.

 

Does that information get you where you need to be?

Harrison Krat
Solutions Architect | Optimizely, Inc.
harrison@optimizely.com
 
lewwwin 11-05-14
 

Re: How to add Crazy Egg snapshot code

Hi @Harrison_Krat 

 

Thank you for repky! I joined the account by the API. However, Crazy Egg requires pasting JavaScript code. Hence my question is how to do it. Tutorial seems to be not complete:

http://oi61.tinypic.com/1hyp91.jpg

 

 

Level 2

Re: How to add Crazy Egg snapshot code

Hi @lewwwin,

 

You can establish JavaScript variables within variation code simply by setting them at the window level.  So just add these lines of code to your original variation:

/* _optimizely_evaluate=force */
window.CE_SNAPSHOT_NAME = "Optimizely DoladujTelefon.pl : KROK 1 CR: Original"; /* _optimizely_evaluate=safe */

You can then do something similar for each of your variations.

 

In order to be able to use the force variation parameter, you'll need to change your Project Code Settings.  Go to your Project Dashboard, then the Project Settings button in the upper right, then Project Code Settings.  Uncheck the box that says, "Disable the force variation parameter."

 

Please let me know if that setup works.

 

Harrison Krat
Solutions Architect | Optimizely, Inc.
harrison@optimizely.com
 
lewwwin 11-09-14
 

Re: How to add Crazy Egg snapshot code

Hi  @Harrison_Krat ,

 

Thanks for reply. Is it now correct implemented?

 http://i57.tinypic.com/2zibmfm.png

 

Level 2

Re: How to add Crazy Egg snapshot code

Yup, that looks good. You can even move that variable cal above your other jQuery code if you want.
Harrison Krat
Solutions Architect | Optimizely, Inc.
harrison@optimizely.com