Builder & Google Analytics

Hello there,
How do I connect the website I created in Builder to Google Analytics?
Do we need a Tracking ID? Or will we integrate it using script code?

Hi @jeagerjaquez! Since you are using Gatsby I would suggest installing gatsby-plugin-google-gtag to easily add Google Analytics to your site globally. You can also track events on your Builder page with a custom code block.
https://forum.builder.io/t/is-there-a-good-way-to-include-facebook-pixel-or-google-analytics-events-in-builder/333

1 Like

Is there something similar for next.js?

Hey @pageperfect, I couldn’t find any google tag plugins online for Next.js but you can add Google Analytics to your Next.js app with a script. Here’s a guide I found:

Add Google Analytics to Your Next.js App in 5 Easy Steps

We also have a lazy-loaded library in beta called Partytown that can boost your site’s performance by relocating third-party scripts off the main thread onto a web-worker. This has been tested with and is known to work for Google Tag Manager. You can read more about it here: