Order of JS scripts loaded

Hi there.

We have hosted our third party JS in Cloudflare zaras. when the the scripts load on our site we want to set the order we want our third party script hosted in cloudflare to load first. currently we can see the zaras script is loaded first how can we go about doing this.

In Zaraz settings, you can disable the “Auto-inject script” option, and then manually add a <script> tag that loads /cdn-cgi/zaraz/i.js somewhere in the HTML of your website. Hope this helps!

1 Like

Hi @kuba_orlik , :slight_smile:

Yes we have loaded Zaraz manually but the script that we have hosted in cloudflare gets injected at the end of other scripts in our site and we can see it’s coming from cloudflare.

We want add lets say script1.js, script2.js, script3.js, etc in cloudflare and when they get injected by zaras script (/cdn-cgi/zaraz/i.js) onto our site script1.js, must be the first script to be loaded before anything.

Like setting the order at which the scripts will be injected onto our site.

What method of injection are you using for all those other scripts? How are they set up?