π οΈ How to Set Up GA4 (With GTM)
Google Tag Manager is a tool that lets you manage and install tracking scripts on your site without editing your site code every time. Google Analytics 4 helps you track what users do on your website, such as page views, clicks, and conversions.
Now letβs walk through how to set everything up.
Step-by-Step Setup
β 1. Create a GA4 Property (Google Analytics)
Visit analytics.google.com
Click "Start Measuring" to create an account
Choose Web as your platform
Enter your website address
After setup, copy the Measurement ID, it looks like
G-XXXXXXX
β 2. Create a GTM Container (Google Tag Manager)
Go to tagmanager.google.com
Click Create Account
Add your site or business name
Choose Web as the target platform
Finish the setup and copy the GTM ID looks like
GTM-XXXXXXX
β 3. Add GTM to Your Website
If you control the code directly:
Paste the first snippet inside the
<head>
tagPaste the second snippet just after the opening
<body>
tag
If you use a website builder, just find the section that allows you to add custom code or scripts, and paste your GTM ID there.
β 4. Add GA4 Tag in GTM
Open your GTM container
Go to Tags β New
Click Tag Configuration β Choose Google Analytics: GA4 Configuration
Paste the Measurement ID from Step 1
Under Triggering, select All Pages
Name the tag something like:
GA4 - All Pages
Click Save
β 5. Publish Your Container
In the top right, click Submit
Name the version something like "Initial GA4 Setup."
Click Publish
β 6. Test to Make Sure Itβs Working
Open your website in a new browser tab
Go back to Google Analytics β Reports β Realtime
You should see your visit appear almost instantly ππ
If youβre using Selar, the process is even easier. After creating your GA4 property and GTM container as described above, log into your Selar dashboard, go to Integrations, then Google Tag Manager, and paste your GTM ID (e.g. GTM-XXXXXXX
). Once thatβs saved, head back into GTM, create a new tag using GA4 Configuration, paste your Measurement ID (G-XXXXXXX
), set the trigger to All Pages, then save and publish the container.