How to best implement Osano's consent manager with Cloudflare's Rocket Loader.
Example: Cloudflare Rocket Loader
Cloudflare's Rocket Loader is a tool utilized by Cloudflare sites to manipulate your website's content. It does this by loading your page content (text, images, fonts, etc.) asynchronously to optimize page loading times. If Rocket Loader initiates Osano, the code is dynamically loaded onto your website. This behavior interrupts Osano functionality which can cause rending issues and/or other conflicts.
For functionality reasons, Osano must execute outside of Rocket Loader's manipulation.
For Osano to function as expected and to keep you in compliance, we recommend utilizing Rocket Loader's "manual" execution which will ensure that Osano is (1) executing first and (2) able to keep compliance by blocking or allowing trackers based on end-user preference. Rocket Loader can be used for "essential" elements that do not set non-essential trackers.
Enable Manual Mode
- In Cloudflare settings, under 'Performance Settings,' set the 'Rocket Loader' option to Manual.
- To selectively enable Rocket Loader optimization for a script, when Rocket Loader is in manual mode, set the attribute data-cfasync="true."
- If needed, manually mark up the elements that you wish to be loaded by Rocket Loader:
<script data-cfasync="true" src="https://example.org/js/"> . This should ONLY be used when scripts do not set non-essential cookies or trackers.