studio1902 / statamic-peak-seo

Belongs to the Statamic Peak Starter Kit and contains all SEO fieldsets and partials.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advanced Tracking scripts

andjsch opened this issue · comments

Is your feature request related to a problem? Please describe.
Currently, it's only possible to add scripts which will be added, once one accepts a certain cookie.

Describe the solution you'd like
Make it possible to add a script, when a cookie is not accepted/unchecked.

Additional context
I'd be willing to work on that feature, if approved.

Hey,

Can you explain to me what the use case is here. Wat you're trying to achieve?

Happy to learn and expand if needed.

Bad services are opt-out instead of opt-in. So for example is Microsoft Dynamics 365 (a CRM). It needs a script to be deactivated -> if not agreed.

See here

First time coming across the need for such a thing as well. So, no big deal if you think it's too rare to support 😄

Oof yeah, that seems very edge case indeed. But the initial script will only be loaded after consent right? So is this needed? If so how would you implement this?

I didn't mean to close this btw. Just noticed and reopened.

Well, in this very specific case, no script is actually loaded after giving consent. Some script is placed at a sign-on page for a newsletter and will set some cookies for tracking, unless, that function is declared telling it not to.

I'd add all these scripts when the consent banner hasn't been dismissed yet or add each one individually if it hasn't been accepted.

I'd do so by adding a function to the x-init of the consent banner.

I'm afraid I'm not really following this use-case so maybe it's to edge case to add. Hope you don't mind. You can always publish the view and add it for your current project!

All good!