Tag timing
Cookie Banner For Google Tag Manager: What Needs To Load First?
Most broken consent setups are timing problems. The banner may look fine, but tracking can still start too early if consent defaults are not ready first.
The simple rule
Your consent setup should run before normal analytics and marketing tags. In GTM, that usually means the CMP tag fires on Consent Initialization - All Pages. This trigger is designed for consent tools that need to prepare the consent state early.
What happens on a first visit
On a first visit, the site does not know the visitor's choice yet. The CMP should set the default consent state, show the banner, and wait for the visitor to choose. Other tags should respect that state.
What happens after a stored choice
When a visitor comes back, the CMP should read the stored choice quickly and apply it before consent-dependent tags make decisions. This matters because many tags run early in the page lifecycle.
Direct install versus GTM install
A direct install means the CMP script is placed high in the page head. A GTM install means the CMP is loaded through a GTM template. Both can work, but the GTM version must use the right trigger and a stable install URL.
Common mistakes
- Firing the CMP on a normal page-view trigger instead of Consent Initialization.
- Adding a banner, but leaving hardcoded tracking scripts outside GTM.
- Using a visual-only cookie notice that never updates Google consent signals.
- Testing only accept all and never checking reject all.
CleanCMP handles the install path
CleanCMP gives you both options: a GTM template for tag-manager setups and a hardcoded runtime snippet for source-level installs.
Create account