/bubble-tutorials

How to set up Google Analytics in Bubble

Learn how to set up Google Analytics in Bubble with a simple, step‑by‑step guide to track user behavior, boost insights, and optimize your app.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.

Book a Free Consultation

How to set up Google Analytics in Bubble

You add Google Analytics to Bubble by placing the GA tracking script (G‑tag) inside Settings → SEO/metatags → Script/meta tags in header, using your Measurement ID from Google Analytics. Bubble then loads the script on every page, and GA starts tracking page views automatically. If you want to track custom events, you trigger JavaScript using Bubble’s “Run javascript” action from the Toolbox plugin.

 

Step‑by‑step setup

 

Google Analytics needs a small tracking script to load on every page. Bubble lets you insert this script globally, so you don’t need to add anything inside page HTML headers.

  • Create a GA4 property in Google Analytics. Copy the Measurement ID (it looks like G-XXXXXXX).
  • In Bubble, open Settings → SEO/metatags.
  • Find the section “Script/meta tags in header”.
  • Paste the GA script and replace G-XXXXXXX with your ID.

 

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);} // Google’s function
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXX'); // Replace with your Measurement ID
</script>

 

Click Save and deploy to live. GA will start receiving page\_view events automatically because Bubble loads full page navigation on most apps.

 

Tracking custom events

 

If you want to track actions like button clicks or signups, install the Toolbox plugin and use the workflow action Run javascript.

  • Add a workflow on any element, like a button click.
  • Select Run javascript.
  • Insert an event call using the gtag function.
gtag('event', 'signup_clicked', {
  method: 'email' // Add any parameters you need
});

 

This is the standard GA4 way and works reliably inside Bubble. No plugins are required except Toolbox for custom JavaScript events.

Explore More Valuable No-Code Resources

How to integrate Bubble.io with Git?

Learn how to seamlessly integrate Bubble.io with Git through our comprehensive step-by-step guide. Perfect for beginners and professionals.

Explore

How to integrate Bubble.io with Reddit Ads?

Learn how to seamlessly integrate Bubble.io with Reddit Ads using our easy step-by-step guide. Boost your ad management today!

Explore

How to integrate Bubble.io with AWS S3?

Explore our step-by-step guide on integrating Bubble.io with AWS S3, making your app development process more efficient and secure.

Explore

How to integrate Bubble.io with Lucidchart?

Follow our step-by-step guide to seamlessly integrate Bubble.io with Lucidchart, enhancing your workflow & productivity.

Explore

How to integrate Bubble.io with Kentico?

Learn how to seamlessly integrate Bubble.io and Kentico with our comprehensive, easy to follow step-by-step guide.

Explore

How to integrate Bubble.io with Box?

Discover easy-to-follow steps for integrating Bubble.io with Box. Boost your workflow and secure your files seamlessly today.

Explore

Stuck in Bubble.io? We’re here to help!

Fix broken workflows | Optimize logic | Boost performance | Scale with confidence

4.9
Clutch rating 🌟
600+
Happy partners
17+
Countries served
190+
Team members

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Cookie preferences