Services Plugins FAQs

Integrating Zeroqode GDPR cookie consent plugin with Bubble's Google Analytics plugin

I’m trying to fire Google Analytics when analytics cookies are accepted. Zeroqude’s documentation says we have to modify the script in the head tag. However, when I emailed Zeroqode, their bot responded with the following:

Rather than providing head tag scripts directly, you should:
1. Set up conditional workflows that check if analytics cookies are accepted
2. Only initialize GA4 tracking when the user has consented to analytics cookies
3. Use the plugin’s state to determine when to start tracking

I have done step 1, but there seems to be no provision for step 2 using Bubble’s GA plugin. So now I’m thoroughly confused about what to do.

Hi @sandeep.jaykumar,

Thanks for the detailed note. I totally get why this is confusing.

Bubble’s native GA4 plugin initializes on page load and doesn’t provide a built-in way to delay GA until Analytics consent is granted. To stay GDPR-compliant with Zeroqode’s GDPR Cookie Consent plugin, the practical two suggestins would be:

  • Use Google Tag Manager (GTM) to control GA4 firing
    Disable Bubble’s GA plugin so it can’t load early. Add GTM to your app, and configure GA4 to fire only when consent is granted. In GTM, you can rely on consent checks and triggers. Two common setups:
    1. GTM + CMP (no Bubble JS): Connect GTM to a Consent Management Platform that natively integrates with GTM (e.g., Cookiebot, OneTrust, etc.). The CMP handles the consent signals; GTM will keep GA4 blocked by default and release it only after “Analytics” is accepted.
    2. GTM reads the GDPR plugin’s consent cookie/value: The GDPR Cookie Consent plugin stores the user’s category choices. In GTM, create a Variable that reads this stored value (as a Cookie or 1st-party storage variable) and use it in your Tag/Trigger conditions so GA4 runs only when Analytics = granted.
  • Alternative (advanced) - Server-side/Measurement Protocol
    If you prefer to avoid any client-side loaders, you can send events from Bubble’s backend only for users who’ve granted Analytics consent (you’d persist consent in your DB and conditionally trigger backend workflows). This avoids client initialization altogether but requires a thoughtful design for user/session identifiers and may not cover all GA4 features.

The key changes are: don’t use Bubble’s GA plugin, move control to GTM (or to backend events), and have GA4 depend on a consent signal that doesn’t require Bubble-side scripting.

Could you let us know which direction you prefer so we can share exact, button-by-button steps?

  • Do you currently use GTM?
  • Are you using a CMP that integrates with GTM (e.g., Cookiebot/OneTrust)?
  • If considering the backend/Measurement Protocol route, do you already store a per-user consent flag in your database?

Appreciate you surfacing this. Happy to help you land on a compliant approach.
Looking forward to your reply.

Best regards,
Support Team
Browse all Zeroqode Plugins for bubble
Banner_Last3