Can I use Cloudflare Rocket Loader with GrowSurf?

Unfortunately Cloudflare Rocket Loader interferes with the way the GrowSurf Universal Code loads on your site and will cause issues with referral tracking inconsistencies.

This is because Rocket Loader defers the loading of all JavaScript until after rendering your webpage.

If Rocket Loader is present on your page and you experience issues with participants inconsistently being added to your campaign, you have three options:

Option 1: Disable Cloudflare Rocket Loader

You can disable Rocket Loader on your site. Follow the instructions here.

Option 2: Update the GrowSurf Universal Code

A simple solution would be to add a data-cfasync="false" attribute to the GrowSurf Universal Code in order to make Rocket Loader ignore it.

Here is an example of the GrowSurf Universal Code updated with that attribute (please make sure to replace YOUR_CAMPAIGN_ID with your own campaign ID):

<script type="text/javascript" data-cfasync="false">
  (function(g,r,s,f){g.grsfSettings={campaignId:"YOUR_CAMPAIGN_ID",version:"2.0.0"};s=r.getElementsByTagName("head")[0];f=r.createElement("script");f.async=1;f.src="https://app.growsurf.com/growsurf.js"+"?v="+g.grsfSettings.version;f.setAttribute("grsf-campaign", g.grsfSettings.campaignId);!g.grsfInit?s.appendChild(f):"";})(window,document);
</script>

For more information, please see this article.

Option 3: Use a Cloudflare Configuration Rule

Alternatively, If Rocket Loader is only impacting a specific page, use a Configuration Rule to exclude that page by URL. Follow the instructions here.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.