HomeBlogCookie Consent + Google Analytics
    Google AnalyticsCookie Consent

    Cookie Consent Banner for Indian Startups Using Google Analytics

    Step-by-step guide to implementing a cookie consent banner with Google Analytics (GA4) and GTM for DPDP-compliant Indian startups.

    Leanops Compliance Team 7 min readMay 9, 2026

    Why This Matters

    Google Analytics (GA4) is the pulse of any startup. But GA4 tracks Client IDs and IP addresses — both Personal Data under DPDP. If you track users without a banner, your data is "poisoned" — illegally collected and could be struck down in an audit.

    Step-by-Step Implementation

    1. 1. Install ConsentLite — Add the lightweight script to your <head>.
    2. 2. Configure Consent Mode — Set the default state to denied for analytics_storage and ad_storage.
    3. 3. Modify GTM Triggers — Replace "All Pages" with "Consent Initialization" or a custom consent_update event.
    4. 4. Test in Preview Mode — Use GTM's Debug mode to verify no Google tags fire before "Accept" is clicked.

    The Most Common Mistake

    "Leakage" — the banner appears, but the Google Analytics script is already running in the background. ConsentLite's auto-blocking feature prevents exactly this.

    Fix Your Tracking Setup

    Before regulators do — get seamless GA4 + DPDP integration with ConsentLite.

    Get ConsentLite for GA4 →

    Frequently Asked Questions

    Will GA4 still work if users reject cookies?

    Yes — Consent Mode v2 sends 'cookieless pings' so you still get aggregated, modeled data.

    Do I need GTM to make this work?

    GTM makes consent triggers easier, but you can also gate gtag() calls in code.

    Will my GA4 numbers drop after this?

    You may see fewer 'tracked' users, but the data you do collect will be 100% legal and high-quality.

    Build trust. Scale globally.
    Stay compliant.

    Leanops helps India's fastest-growing startups achieve SOC 2, GDPR, ISO 27001, and DPDP compliance — so you can win enterprise clients and expand globally.