Ga4 Consent Install

    1

    Implements privacy-first Google Analytics 4 with Consent Mode default-denied and policy disclosures.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    ga4-consent-install

    Example session with this skill installed

    I need to install GA4 on my site. The measurement ID is G-8Y7T6R5E4W. Help me set up the code so it respects user consent and write the privacy policy section.

    • Read your context and instructions
    • Compiled the ga4-consent-install

    I have configured the GA4 installation to respect Consent Mode default-denied and drafted the privacy disclosure.

    GA4 Consent Implementation

    <!-- Google Consent Mode Default Denied -->
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      
      gtag('consent', 'default', {
        'ad_storage': 'denied',
        'analytics_storage': 'denied'
      });
    </script>
    
    <!-- Load GA4 only after consent (Trigger this on 'Accept' click) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-8Y7T6R5E4W"></script>
    <script>
      function initializeTracking() {
        gtag('js', new Date());
        gtag('config', 'G-8Y7T6R5E4W');
        gtag('consent', 'update', {
          'analytics_storage': 'granted'
        });
      }
    </script>
    

    Privacy Policy Section

    Analytics Disclosure
    We use Google Analytics 4 (Measurement ID: G-8Y7T6R5E4W) to understand site traffic. This tool collects page views, approximate location, and device type. Data collection is strictly disabled until you provide explicit consent via our cookie banner. You can withdraw your consent at any time by clearing your browser cookies or clicking the 'Manage Consent' link in our footer.

    Next steps

    1. Insert the default-denied script block above your site head.
    2. Link your cookie banner's "Accept" button to the initializeTracking() function.
    3. Verify hits in the browser network log after clicking accept.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Manual implementation of Google Analytics 4 often leads to privacy violations or broken data. This skill automates a privacy-first GA4 installation that defaults to denied consent.

    What it does

    • Consent gating prevents tracking tags from firing until a user explicitly clicks accept on a cookie banner.
    • Default-denied mode configures Google Consent Mode to block data transmission by default.
    • Privacy documentation generates necessary disclosure text including data collection types and withdrawal methods.
    • Implementation verification provides a checklist for network log and Tag Assistant validation.

    How it works

    1. Property setup where a unique measurement ID is assigned to a specific data stream.
    2. Tag configuration involving the placement of the script with conditional firing logic.
    3. Policy update to reflect the specific measurement ID and GA4 collection behaviors.
    4. Validation testing across key page types to ensure hits are only sent post-consent.

    Frameworks & tools

    This skill is designed for web developers using Google Analytics 4, Google Tag Manager, or direct gtag.js implementations.

    Why this beats prompting it yourself

    Generic prompts often produce tracking code that fires on page load, violating GDPR and CCPA. This skill enforces a "never track before consent" rule and includes the specific legal disclosures required for GA4.

    Use cases

    • Deploy GA4 to a new production site with strict privacy requirements.
    • Fix an existing installation that is tracking users before they accept cookies.
    • Generate compliant privacy policy sections for analytics disclosure.
    • Audit a deployment to ensure the measurement ID matches the specific site.

    Known limitations

    Does not provide the UI components for the cookie banner itself. Standard GA4 reports may lag by 24 to 48 hours before data appears.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Research & Analysis.

    Does not provide cookie banner UI components. Standard GA4 reports have a 24-48 hour data lag.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 day ago

    Permissions

    No special permissions declared or detected

    Listed1 day ago

    What's inside

    Frequently Asked Questions

    This skill automates the configuration of GA4 with a 'denied' default state, ensuring no data is transmitted to Google servers until a user explicitly opts in, keeping you compliant with GDPR and CCPA.

    No, this skill focuses on the logic and tag configuration; you will need to provide your own UI banner or use a Consent Management Platform (CMP) to trigger the consent signals.

    It is designed for web developers and site owners using Google Tag Manager (GTM) or direct gtag.js implementations across any standard web framework.

    You receive the structured configuration logic for GA4, the conditional firing rules for your tags, and generated privacy policy disclosure text tailored to your measurement ID.

    Yes, it includes an implementation verification checklist that walks you through using Google Tag Assistant and network logs to confirm tags only fire after consent.

    While the skill sets up the tracking correctly, Google Analytics 4 typically has a 24 to 48-hour processing delay before data appears in your standard reporting dashboard.

    New in Research & Analysis