In this guide
- Set a default consent state before Tag Manager loads, then push an update when the visitor chooses.
- Use
gtag("consent", "default", ...)andgtag("consent", "update", ...), with the four Google signals. - Push a custom event too if you need to trigger tags after the choice. Test accept, reject and partial.
A consent platform does two jobs: it asks the visitor, and it tells your tags what they said. The second job is a pair of small calls, and the details decide whether your tags behave. Many problems come from the update arriving late, or from the default being set after the container loads. This page shows the calls, the order and a testing routine. It assumes Google Consent Mode; see Consent Mode v2 for the ideas, and cookie banners for the whole set-up.
The order that works
Define the data layer and gtag function
Before any other script.
Set the default consent
Before the Tag Manager snippet loads.
Load Tag Manager
Tags now see the default state.
Show the banner
Your consent platform asks the visitor.
Push the update
When the visitor chooses, and on later visits when a stored choice is read.
Connected in minutes
Add your domain, install the pixel, connect your ad platforms and watch the first events land.
The default
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag("consent", "default", {
ad_storage: "denied",
analytics_storage: "denied",
ad_user_data: "denied",
ad_personalization: "denied",
wait_for_update: 500
});
</script>
<!-- Tag Manager snippet goes after this -->wait_for_update gives your consent platform a short time, in milliseconds, to send a stored choice before tags decide what to do. Use a value that suits your platform. Set defaults to denied for regions where opt-in is required. You can set different defaults by region with the region option.
The update
gtag("consent", "update", {
ad_storage: "granted",
analytics_storage: "granted",
ad_user_data: "granted",
ad_personalization: "granted"
});
// optional: a custom event your triggers can listen to
dataLayer.push({ event: "consent_updated" });Most consent platforms make these calls for you. Check their documentation and verify with Preview rather than trusting the settings page.
Works with your stack
Grab a logo and throw it. These are the tools Open Tracked already talks to.

Why a custom event helps
Some tags are not consent-aware and fire only on a trigger. You can fire them on a custom event such as consent_updated, with a condition that checks the consent state, so they run after the choice and not before. Google's own tags adjust automatically through Consent Mode.
Server-side
The web container sends the consent state with its requests (in parameters such as gcs and gcd). A server container reads them. Add consent settings or trigger conditions to server tags that send personal data, such as Meta and TikTok. With Open Tracked, the Enricher has consent switches for what it may store and add, and Cookie Keeper only restores what you allow. See GTM and GDPR.
Test
- Open Preview and load the page in a private window.
- Check the Consent tab: default state shown for each tag.
- Choose reject: tags that need consent should not fire.
- Choose accept: the update should appear and tags should fire.
- Reload: the stored choice should be read and the update pushed quickly.
- Check the server Preview for the consent state on requests.
Common problems
wait_for_update.Runs on your domain, anywhere
Your tracking runs on your own domain, so a visit from any country is handled the same way.
Frequently asked questions
What is a consent update?
A call that tells tags the visitor's new consent choices after the default state.
What does wait_for_update do?
It gives your consent platform a short time to send a stored choice before tags decide what to do.
Do I need a custom event?
Only for tags that are not consent-aware and need a trigger after the choice.
How do I test consent?
In Preview, in a private window, with accept, reject and partial choices.
Does the server container need the consent state?
Yes, so server tags can respect it.
Do I need spreadsheets to read my results?
No. Once tracking is live, the Open Tracked analytics shows spend, revenue, ROAS and profit, and you can ask Ari, the built-in AI assistant, questions about your own numbers in plain words. Ari's allowance depends on your analytics plan.
Is Open Tracked different from Open Track or Open Space Track?
No. Open Tracked is the official name of our server-side tracking platform, and the website is opentracked.io. Many people search for it as Open Track, OpenTrack or Open Space Track. All of them lead to the same product: server-side Google Tag Manager hosting, first-party analytics and a CRM pipeline.

Fix your tracking at the source
Open Tracked hosts your server-side Tag Manager, keeps first-party cookies alive and shows what each ad is really worth.
The Open Tracked team
We build Open Tracked: server-side tracking hosting, analytics and the tools around them, for stores that spend on ads. Questions about this guide, or an idea for the next one?
Comments
Loading comments...
