SEO & AI·4 min read·

How do I connect Google Analytics 4 to my VeloCMS blog?

Add your GA4 Measurement ID in the Google Analytics 4 plugin (Admin → Plugins) and VeloCMS injects the tracking script on every public page.

To connect Google Analytics 4 to your VeloCMS blog, copy your GA4 Measurement ID (the G-XXXXXXXXXX code from your Google Analytics property settings), go to Admin → Plugins, install the Google Analytics plugin, paste the ID into the plugin's Measurement ID field, and click Save. VeloCMS injects the gtag.js script on all public pages automatically from that point forward — no template editing, no manual script tag insertion.

Where do I find my GA4 Measurement ID?

Log into analytics.google.com, select your property, and go to Admin (the gear icon in the lower-left) → Data Streams → click your web stream. The Measurement ID is displayed at the top right of the stream details panel and starts with G- followed by ten alphanumeric characters (for example G-ABCDE12345). If you haven't created a GA4 property yet, the Google Analytics help center has a step-by-step setup wizard — the only thing you need to provide is your blog's URL (yoursubdomain.velocms.org or your custom domain).

How does VeloCMS inject the tracking script?

VeloCMS renders the GA4 snippet into the page's head when it builds each public page on the server. The snippet prepares Google's dataLayer and Consent Mode signals first, then loads gtag.js asynchronously — the tracking script never blocks your page's rendering. The implementation follows Google's recommended gtag.js setup: a script loading gtag.js from googletagmanager.com, followed by the initialization call with your Measurement ID.

Does the analytics script fire on admin pages?

No. The snippet is only rendered by your public site's layout, so the admin dashboard never includes it — and that's the right thing for your data, since your own editing sessions look nothing like a real reader visit and would inflate your session counts. The tracking script loads on your public surfaces: the blog home, post detail pages, tag and category archives, and any pages you publish. Note that a reader running an ad blocker can still prevent gtag.js from loading — that's normal and affects every site using GA4.

What events does VeloCMS track automatically?

VeloCMS relies on GA4's Enhanced Measurement, which Google enables by default for all new properties. Enhanced Measurement automatically tracks page views, scroll depth (measuring 90% scroll as a deep-read signal), outbound link clicks, site search queries, and video engagement for YouTube embeds. You don't need to set up any custom events for these — they just work once the Measurement ID is connected. For more advanced tracking like reading time or conversion events, you'd configure custom events through Google Tag Manager — VeloCMS has a Google Tag Manager plugin in Admin → Plugins, so you don't need to paste any code by hand.

If your blog has European readers, adding GA4 without a consent mechanism may violate GDPR. VeloCMS handles this for you: once a consent-requiring provider like GA4 is enabled, a cookie consent banner appears automatically for visitors in the EU and UK (or whose country can't be determined) — there's no separate switch to turn on — and the GA4 script stays dormant until the reader accepts analytics cookies. Visitors outside the EU and UK are tracked without seeing the banner.