Thread Starter
aggk
(@aggk)
I think I understand how to control this now by using content blocker instead?
Works great!
Thanks!
Hi @aggk !
Thanks for your message.
Since the scripts are executed asynchronously through JavaScript (not HTML!), as they are first checked for consent, it does not matter whether they are in the head area or the footer/body area.
For Google Analytics in particular, it does not matter at what time this is loaded (as soon as you use a cookie banner, this is at the earliest at the time of “interactive”; https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState).
Thread Starter
aggk
(@aggk)
Thank you for explaining!
So what is the preferred way?
I have one analytics script that I normally place in the head.
and another script that includes a chatservice which I place in the footer.
From what I understand I can control these either by placing the scripts under different “Services” > “My service” > “Code executed on opt-in”
…or by using “Content blockers” that defines which URL/Elements to block ?
Thanks!
Hi again!
Yeah, you can go two ways:
Preferred way: Remove your scripts from your head, and use the “Code executed on opt-in” field to only run the code if the user has given consent to that service. You do not need a Content Blocker for this.
The other way: Keep the scripts in your head and block them with a content blocker.
Regards,
Matthew 🙂