A cookie banner that does not block anything is decoration. Real cookie consent banner implementation has two halves: a banner that asks clearly and records the answer, and tag gating that keeps analytics, advertising and session-recording scripts from loading until the matching category is granted. Most sites get the first half and skip the second.
Open your browser's developer tools on your own store, clear cookies, load the home page without touching the banner, and look at the cookie list and network tab. If you see analytics or ad pixel cookies already, the banner is not doing its job. That five-minute test is where every engagement should start, and if it fails, we can scope the fix.
Step one: an honest inventory of tags and cookies
You cannot gate what you have not found. Build a register that lists every script, pixel and cookie, where it loads from and who asked for it.
- Tag manager tags: GA4, Google Ads, Meta, LinkedIn, Microsoft Ads, heatmaps.
- Hard-coded scripts in theme files, checkout templates and landing pages built outside the main CMS.
- App and plugin scripts from Shopify apps, WordPress plugins, chat widgets, review widgets and A/B testing tools.
- Embedded media such as YouTube or Vimeo players, which set cookies of their own.
Assign each item a category (strictly necessary, functional, analytics, advertising) and an owner. This register also becomes the cookie table in your policy, so it has to stay current.
Designing the banner itself
Categories people can understand
Keep the category list short and the descriptions plain. "Analytics: helps us understand which pages are useful" beats a list of vendor names. Strictly necessary items, such as the cart, login session, fraud prevention and the consent cookie itself, do not need a toggle.
Choices that are genuinely equal
European regulators have repeatedly criticized banners where "Accept all" is a bright button and rejecting takes three clicks. Offer accept and reject at the same level, with a link to granular settings, and keep a persistent link (often in the footer) to change preferences later.
Language and regional behavior
For Indian audiences, the DPDP framework expects notices to be available in English or a language listed in the Eighth Schedule, so plan for translated banner text rather than English only. For US visitors, decide how you handle the Global Privacy Control browser signal, which California's rules treat as an opt-out of sale or sharing. Geo-specific behavior is fine as long as it is deliberate.
Tag gating: where cookie consent banner implementation succeeds or fails
Gating must happen at the point a script loads, and it must react to changes without a page reload.
Inside Google Tag Manager
Set a Consent Initialization tag that applies default states before anything else, then use built-in consent checks for Google tags and "additional consent required" settings for everything else. Wire the banner to Google Consent Mode v2 so the four Google signals update with each choice; our article on GA4 setup covers the measurement side.
Scripts outside the tag manager
Hard-coded scripts are the biggest leak source.
The text/plain pattern
Change the script's type attribute to text/plain and add a data attribute naming its category. The browser ignores it until your consent script swaps the type and re-inserts the element after the category is granted. Most commercial CMPs support this pattern; if you build it yourself, handle scripts that inject further scripts.
Iframes and embeds
Replace embedded players with a lightweight placeholder that loads the real iframe on click or after functional consent, or use privacy-enhanced embed domains where the provider offers them.
Server-side tagging
A server container reduces browser scripts but does not remove the consent obligation. Pass the consent state with each request and make sure the server only forwards events to vendors whose category was granted.
What changes for e-commerce stores
Online stores have more scripts and more money riding on measurement, so a few extra rules apply.
- Checkout must keep working. Payment gateway, fraud and cart scripts are strictly necessary; never let a misconfigured category block them.
- Use platform APIs. Shopify's Customer Privacy API lets themes and apps read consent, so prefer apps that respect it. On custom stacks, expose consent state through one shared module.
- Conversion tracking on the thank-you page is where hard-coded pixels hide. Audit it separately.
- Performance. A banner that blocks rendering or shifts layout hurts conversions and Core Web Vitals. Load it early but light, and reserve space so the page does not jump.
iJurug Soft handles this as combined web engineering and analytics work: inventory, banner integration with the CMP you choose, GTM and code-level gating, server-side container rules and performance checks. If you are still selecting a platform, our checklist for configuring a CMP before go-live covers the selection side.
A launch checklist
- With no choice made, no analytics, advertising or session-recording cookies are set and no requests reach those vendors.
- Reject all: same result, and it persists across pages and visits.
- Accept a single category: only that category's tags load, without a reload.
- Withdraw consent from the preferences link: tags stop, and non-essential cookies your domain set are removed where possible.
- Checkout, login and payments work in every state.
- Consent records store the choice, timestamp and banner version.
Frequently asked questions
Can we just use a WordPress or Shopify plugin?
Often, yes, for the banner. The plugin still needs configuring, and it will not catch scripts hard-coded in themes or loaded by other apps. The inventory and testing work remains.
Does blocking tags until consent wreck our analytics?
You will see fewer tracked sessions from visitors who decline. Consent Mode v2 in advanced mode and server-side tagging can recover some modeled insight for Google products, within what visitors allowed.
How often should the cookie inventory be reviewed?
Review whenever marketing adds a tool or the site is redesigned, and on a regular schedule otherwise. Automated scans help, but a human should confirm categories.
Run the five-minute test from the top of this article first. If cookies or vendor requests appear before anyone clicks the banner, tell us your platform and the CMP you use via the contact form or at info@ijurugsoft.com, and we will map which scripts are leaking and how to gate them.