Add Google Tag Manager to your site
Learn how to install Google Tag Manager on your Framer site and connect it to Google Analytics 4.
Google Tag Manager (GTM) lets you manage tracking tags without modifying your site's code. This guide shows you how to install GTM in Framer, connect it to Google Analytics 4 (GA4), and verify that everything is working correctly.
If you only want to use Google Analytics, follow the dedicated Google Analytics setup guide instead.
Create a Google Tag Manager container
Go to tagmanager.google.com.
Click Create Account.
Enter your Account Name and Container Name.
Select Web as the target platform.
Accept the terms and create your container.
Google Tag Manager will display two code snippets. You’ll add both to your Framer site in the next step.
Add the Google Tag Manager code to Framer
Open your Framer project.
Go to Site Settings → Code.
Add the first GTM snippet as a custom code entry with these settings:
Setting | Value |
|---|---|
Placement | Start of |
Pages | All |
Run | Once |
Add the second GTM snippet as another custom code entry with these settings:
Setting | Value |
|---|---|
Placement | Start of |
Pages | All |
Run | Once |
Connect Google Tag Manager to Google Analytics
To send data to Google Analytics, you’ll need a GA4 property and web data stream.
Go to analytics.google.com.
Create a GA4 property and a Web data stream if you don't already have one.
Copy your Measurement ID.
Return to Google Tag Manager.
Create a new Google Tag.
Paste your Measurement ID into the Tag ID field.
Set the trigger to Initialization – All Pages.
Save the tag.
Verify your setup
In Google Tag Manager, click Preview and connect to your published website.
Confirm that the Google Tag fires successfully in Tag Assistant.
In Google Analytics, go to Admin → DebugView.
Visit your site and confirm that events, such as
page_view, appear.
If Preview mode doesn’t connect, try installing the Tag Assistant Companion browser extension.
Publish your changes
After you’ve confirmed that everything is working correctly, click Submit in Google Tag Manager and publish your container.
FAQ
Do I need both Google Tag Manager and Google Analytics?
No. If you only need basic website analytics, you can install Google Analytics directly. Google Tag Manager is useful when you want to manage multiple tags or configure advanced tracking.
Why isn’t Preview mode connecting to my site?
Make sure you’ve published your latest changes in Framer and installed both GTM code snippets in the correct locations. Browser extensions or privacy settings can also interfere with Preview mode.
Can I track button clicks and other custom events?
Yes. Google Tag Manager supports custom triggers and events for buttons, links, forms, and many other interactions. These are covered in separate guides.
Updated
