How to Add Google Analytics 4 (GA4) to Your Pixelesq Site
Quick Answer
Go to Project Settings → Custom Tags, add a new script tag with your GA4 Measurement ID, and publish your site. Tracking begins immediately on all pages.
What You Need
- A Pixelesq account with an active project
- A Google Analytics 4 property (create one free at analytics.google.com)
- Your GA4 Measurement ID (starts with
G-)
Step 1: Get Your GA4 Measurement ID
Log in to Google Analytics → Click the Admin gear icon → Under your property, click Data Streams → Select your web stream → Copy the Measurement ID (e.g., G-ABC123XYZ).
If you don't have a GA4 property yet, click Create Property and follow Google's setup wizard. It takes about 2 minutes.
Step 2: Open Custom Tags in Pixelesq
In your Pixelesq dashboard, go to your project → Click Settings in the sidebar → Scroll to the Custom Tags section.
This is where you can add any tracking scripts, meta tags, or custom code to your site's <head> or <body>.
Step 3: Add the GA4 Script Tag
Click Add Tag and add the following two script entries:
Tag 1 (GA4 library):
- Type:
script - Placement:
head - Add attribute:
src=https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX - Add attribute:
async
Tag 2 (GA4 initialization):
- Type:
script - Placement:
head - Content:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');Replace G-XXXXXXXXXX with your actual Measurement ID in both tags.
With AI: You can also tell the Pixelesq AI agent: "Add Google Analytics to my site with ID G-XXXXXXXXXX" and it will configure the tags for you automatically.
Step 4: Save and Publish
Click Save to store your custom tags. Then publish (or re-publish) your pages. The GA4 script is now injected into the <head> of every published page on your site.
Step 5: Verify Tracking Is Working
Open your published site in a browser → Go to GA4 → Click Reports → Realtime. You should see your visit appear within a few seconds.
You can also install the Google Tag Assistant Chrome extension to verify tags are firing correctly on your site.
Pro Tips
- Don't double-count: If you're using Google Tag Manager and adding GA4 through it, don't also add the GA4 tag directly. Pick one method.
- Enable Enhanced Measurement: In GA4, turn on Enhanced Measurement for your data stream. This automatically tracks scrolls, outbound clicks, site search, video plays, and file downloads with zero extra setup.
- Use Pixelesq's built-in analytics too: Pixelesq has its own analytics dashboard with live visitors, AI-powered insights, and Core Web Vitals. Use both for a complete picture.
Troubleshooting
GA4 isn't showing any data
- Make sure you've published your pages after adding the tags
- Verify the Measurement ID starts with
G-(notUA-, which is the old Universal Analytics) - Check that you don't have an ad blocker active while testing
Data appears delayed
- Realtime data should appear within seconds. Standard reports can take 24-48 hours to populate. This is normal GA4 behavior, not a Pixelesq issue.
Tracking only works on some pages
- Custom tags are injected site-wide on all published pages. If a page isn't tracking, make sure it has been published (not just saved as draft).
Where do I find my GA4 Measurement ID?
In your Google Analytics account, go to Admin → Data Streams → select your web stream. Your Measurement ID starts with G- (e.g., G-XXXXXXXXXX). It's displayed at the top of the stream details page.
Does Pixelesq support Google Analytics 4?
Yes. Pixelesq supports GA4 through its Custom Tags feature. Add your GA4 script in Settings → Custom Tags, and the tracking code is automatically injected into all published pages. You can also ask the AI agent to set it up for you.
Can I use Google Tag Manager instead of adding GA4 directly?
Yes. If you prefer GTM for managing multiple tags, you can add GTM via Custom Tags instead. Just don't add GA4 both directly and through GTM, as that causes double-counting of pageviews and events.
Will GA4 tracking work on my custom domain?
Yes. Once you've added your GA4 tags, tracking works on any domain connected to your Pixelesq project, including your custom domain and the default Pixelesq subdomain.
How do I verify that GA4 is working on my Pixelesq site?
After publishing, open your site in a browser and check GA4's Realtime report. You should see your visit appear within a few seconds. You can also use the Google Tag Assistant Chrome extension to confirm tags are firing.