Where should I install the OptinStack script?
I have Google Tag Manager, analytics, and a few marketing scripts in my page head. Where exactly should I add OptinStack, and can I use async or defer so it does not slow down the page?
I have Google Tag Manager, analytics, and a few marketing scripts in my page head. Where exactly should I add OptinStack, and can I use async or defer so it does not slow down the page?
Add the OptinStack runtime as the first element inside <head>, before GTM, analytics, advertising scripts, or third-party embeds. Do not add async or defer to the OptinStack script. Loading it synchronously and early gives the runtime its best opportunity to apply the published consent rules before later resources run.
Use the installation snippet generated in your dashboard because it already contains the correct project ID. If a tag manager or platform injects a Tracker above OptinStack, that resource may run before consent enforcement is available.
Documentation: Install OptinStack and Integration patterns.