Bubble and Google Analytics 4

Does bubble’s official plugin for Google Analytics support Google Analytics 4?


I have the same question. It looks like it doesn’t for me!

1 Like

:up: :up:

I suggest to moved from the plugin to Google Tag Manager.

how do you do this? There’s one plugin and it’s got a bug where it adds an extra body tag with some random characters.

Google Tag Manager (https://tagmanager.google.com/) is a container where you can add all the tracking code you need. Not only Google Analytics but AdSense, Facebook, etc. This means that on your site you need to add just one code linked to GTM and then the container will do the rest, passing data to Analytics, Facebook and everything else you have there. Should you need to update a tracking code, you need to edit / update the tags property in GTM without touching the code on your website.

Install GTM in Bubble is easy. No need for plugins. Go into your app settings / SEO metatags and add the GMT code in the advance settings section. Follow the instruction from GMT but it’s simple. There is one portion of code to copy/paste into the header and one portion into the body. See the attached screen shot.

I hope it helps :wink:


@stefanof – thank you!

I’ve implemented the code, but I’m struggling to figure out what to put in Toolbox to send a custom event to GTM. I’m trying to trigger upon clicking a button. Here’s what I have in Toolbox already. Any additional advice?



^^ likewise struggling. I would like to track a sale + conversion value

1 Like

+1 I also look for a solution, but nothing works.
If anyone can help us that will be great!
Thank you

1 Like

Hi all, is this the correct way of adding Google Analytics v4 Data Streams to Bubble app header?


1 Like

Hey, did you conclude if this is the right way to add the google analytics data stream to the header? Thanks!

yes, it worked for me

Tried all that above, including delting properties and creating new data streams for ga4, nothing worked. This is so frustrating, should be piece of cake.

I had a lot of teething issues and made this plugin specifically for GA4. And specifically to deal with Single Page Applications. Happy to give everyone on this thread free usage for their app. GA4 - for Single Page Apps Plugin | Bubble

Just ping me with your app name so I can authorise it.



Is this offer still available?

Hi Guys,

We tried to put the google tag manager code in the SEO header script as described in this thread, but in the end we removed it and put it in the plugin instead.
The problem is that since then we get a weird sad smiley face on page load before the rest of the page loads. It looks like this:
(see screenshot)

Does anybody have any idea what it is and how we can remove it?


It’s because the cut and paste of that script isn’t exactly as it ought to be. :frowning: Double check that you cut and pasted the script exactly correctly. Double check the script is surrounded/enclosed with script tags. Double check that you did not put <script> tags inside some other tags.


1 Like

Hi Lindsay, thank you for your response!!

The thing is that we removed the script, so it is empty:

Any idea why it could happen then? Thx!

If you can share the url of the webpage, maybe by inspecting the source I might be able to see the glitch. It really seems to me to be some malformed JavaScript. It could be some other plug-in perhaps. Maybe ! :slight_smile:

Thanks Lindsay!
Your response got me on the right track - in the end I removed the plugin and instead put the script in the header manually. Now it works fine :slight_smile: :+1: