Rich-text Reply

Optimizely and Cloudflare

RyanJ 11-05-15
Accepted Solution

Optimizely and Cloudflare

I'm trying to use Optimizely alongside Cloudflare but for some reason it doesn't seem to be allowing experiments to run. I've added the following before the Optimizely snippet <script data-cfasync="false" but cloudflare still appears to be preventing my site from running experiments. Are you aware of this issue? Does anyone have a solution?

Level 2

Amanda 11-05-15
 

Re: Optimizely and Cloudflare

Hi Ryan, Can you share the URL where you have the Optimizely snippet added so we can take a look and see if Optimizely is being defined properly? Also, can you provide more information on what you mean by "preventing" your site from running experiments? Are you seeing an error in the editor, or are you able to start your experiment, you just don't see the changes? Thanks! 

Optimizely
RyanJ 11-05-15
 

Re: Optimizely and Cloudflare

Sure, the homepage is here: http://www.currentbody.com/ you can see the Cloudflare snippet on there too. I am able to start the experiments (I had 4 running), but once I had cloudflare running the experiments stopped. Let me know if you need anything else Smiley Happy

 

 

Level 2
Amanda 11-05-15
 

Re: Optimizely and Cloudflare

Sorry, I'm not that familiar with Cloudflare. When I visit that URL I can see that there are 2 experiments running. Do you have to actually turn Cloudflare on outside of the snippet being there? 

 

Screen Shot 2015-11-05 at 9.04.08 AM.png

 

When did this happen to you? I want to make sure it wasn't because you went over your 50,000 visitor alottment for the month. If that happens, experiments will be paused. 

Optimizely
RyanJ 11-05-15
 

Re: Optimizely and Cloudflare

Yes we've turned it off at the minute. It's a CDN that we're using to speed up the site, but when it's live the experiments don't show. The snippet above is what they say we should add in order for the Optimizely snippet to work, but it doesn't for some reason... It happened today around 4pm? I don't think it's to do with the visitor allotment, but feel free to check :-)
Level 2
Amanda 11-05-15
 

Re: Optimizely and Cloudflare

Nope - you're right. I just wanted to double check. Very strange. I am going to open a support ticket to investigate this. If there's any way you could share a staging or sample page with both of these turned on, that might be helpful to debug. This might also be something that Cloudflare's team is better able to help with. 

 

Optimizely
JDahlinANF 11-05-15
 

Re: Optimizely and Cloudflare

@RyanJ -
Just to confirm... You need to add that attribute TO the optimziely snippet, not before it.
The way you have it on the site right now is close, but the data attribute is backwards.
change

<script src="//cdn.optimizely.com/js/3320600494.js" data-cfasync="false">

to

<script src="//cdn.optimizely.com/js/3320600494.js" cfa-datasync="false">

 

 

Re: Optimizely and Cloudflare

hey @nap0leon

 

Thanks for your reply, this was implemented as per this page from CloudFlare:
 


It does need to be data-cfasync="false" and not cfa-datasync="false", and they state it needs to be placed before the 'src' attribute. We are trying a few things out so will update the post if we find a solution Smiley Happy

JDahlinANF 11-06-15
 

Re: Optimizely and Cloudflare

@DavidmannheimYou're right - I was lookign at some bad documentation.

 

To match the current documentation, the change you need to make is to position the data attribute before the src attribute, like this:

 

<script data-cfasync="false" src="//cdn.optimizely.com/js/3320600494.js">
RyanJ 11-07-15
 

Re: Optimizely and Cloudflare

Thanks @nap0leon

Level 2