Rich-text Reply

Snippet Placement

shirley 05-08-14

Snippet Placement

[ Edited ]

Does anyone know if you can see if the developer has put the snippet in the correct place? We recently had this done and would like to know it's in the proper place.

 

 

Level 2

AdamA 05-09-14
 

Re: Snippet

Hi Shirley,

 

We can definitely take a look at that if you let us know your URL!

 

Thanks,

Adam

Optimizely
willegan 05-09-14
 

Re: Snippet

Hi Shirley,

It's quite simple to check if the code snippet is present on your website and in the correct place.

To check the code snippet is present simply right click anywhere on the page that you are wanting to run your experiments on. A drop down will appear, select 'View Source Code'. This will load another tab or window that contains the source code.

Use your browsers inbuilt find tool (cmd+F/ctr+F) and paste the code snippet from Optimizely in the find window as the search query. If you have the code snippet on your site the find tool will automatically highlight it for you.

Regarding it's placement, the Optimizely script loads quite slow so best practice would be to place it at the end of the body tag of the HTML, the reason being that slow javascript (JS) files (especially if they don't load asynchronously will cause the page to load very slowly). Typically to improve performance you would place slow JS files towards the end. However, the Optimizely script is unique - it's slow but needs to be placed at the top of the document. This is because as soon as it's rendered it instructs the browser to re-direct the user to one of the variations of your test.

If you place the JS at the bottom of the page it will load right at the very end of the page. This will result in the user seeing your placebo test (the original version) and then instantly being presented an alternate version of the page (one of your variations).

Hope this information helps,

@willegan
Melbourne, Australia
Level 2
shirley 05-09-14
 

Re: Snippet

Thank you willegan. This helped a lot. Using your method, it seems the snippet is not there even though we were told it is. Which is maybe why we've seen no change in how slow the RFI loads (a very very long time) or any responsive which it was also lacking before.

 

Much appreciated!

Shirley

Level 2
shirley 05-09-14
 

Re: Snippet

[ Edited ]

Adam,
It is asuonline.asu.edu/value
Thank you. I followed willegan's reply and did not find the snippet.

Shirley

Level 2
AdamA 05-09-14
 

Re: Snippet

Hi Shirley,

 

I checked the site and it looks like Optimizely isn't installed there. What you're looking for is a line of code that looks like this: <script src="//cdn.optimizely.com/js/12345678.js"></script>

 

But instead of 12345678, it would be your actual project ID.

 

We recommend implementing the snippet right under your head tag, so yours would look like:

 

<head profile="http://www.w3.org/1999/xhtml/vocab">

<script src="//cdn.optimizely.com/js/[your project ID].js"></script>

<meta charset="utf-8" />

 

For more information on the snippet, please read our article about implementing the snippet.

 

Thanks, and please let me know if that gets you up and running!

Optimizely
shirley 05-09-14
 

Re: Snippet

[ Edited ]

Thanks Adam. I got an email from Optimizely saying the snippet had been successfully installed (see attached), but we noticed no difference and then the client asked if we could tell it'd been done.
We've re-contacted the developer. I know the process of putting it in, but I am not the one with access. I sent all the instructions to the developer previously. I only want to see if it's there.


Shirley

Screen shot 2014-05-09 at 1.25.50 PM.png
Level 2
AdamA 05-09-14
 

Re: Snippet

Hi Shirley, my best guess is that the snippet got installed on a different page than the one you're trying to test. I've checked within the page you sent me, as well as in your experiment settings, and it doesn't look like the snippet is on the page. When you get back with the developer, I'd see if they can add the snippet to the head tag site-wide.
Optimizely