🍪 Cookie banner + GTM 🍪
Basic usage with Google Analytics
Create a tag, e.g. GA4.
Open the tag.
Then add a trigger “Consent Initialization”.
Save and publish your tag.
Going forward, when your customers visit your site, they will not be tracked until they accept a cookie banner consent.
Usage with other external tools
Create a tag, add your third-party code to it.
Open the tag.
Add a “Custom event” trigger.
You can use these custom event names depending on third-party code category and use-case:
onepage_received_consent
onepage_received_consent_unclassified
onepage_received_consent_marketing
onepage_received_consent_analytics
onepage_received_consent_functional
So, when the user chooses some tool categories in the cookie banner, corresponding events will be triggered and GTM will load only those scripts that are depending on a custom trigger.
Save and publish your tag.
Go to your project settings in Onepage and add some cookies that your script will produce, so your customers will see what third-party tools you are using and their use cases.
Going forward, when your customers will visit your site, they will be able to disable the loading of third-party scripts, and they will not receive any cookies.
You should add a separate tag and different custom triggers depending on the tool category for each third-party code.
💡Do you have any feedback concerning this article? Please let us know through our live chat or at support@onepage.io, so we may keep it up to date. Thank you! 🙂