Integration

Foundation CMS and Google Analytics

Foundation CMS has Google Analytics 4 built in as a setting: paste the measurement ID and the site draws the tag itself, behind its privacy box, in consent mode. A successful form submission is sent to Analytics as a lead, so enquiries show up as conversions without anyone writing tracking code.

Overview

This integration connects Foundation CMS with Google Analytics 4. Foundation CMS is Swarm Labs' multi-tenant content management system on Cloudflare Workers. It holds a site's content and hands it to the site as whole, typed records, and every site runs as its own Worker with its own database and media bucket. Analytics is switched on per site in the Foundation CMS settings by entering the property's measurement ID, the value beginning G- from its data stream. No script is pasted into the CMS: the site draws the tag itself.

Business Context and Core Use Case

Most businesses want two answers from analytics: how many people came, and how many of them got in touch. The first is standard; the second usually needs a developer to wire form events into Google's tag. On a Foundation CMS site the lead is sent for you. When a visitor submits a site form successfully, the site sends a generate_lead event, so enquiries appear in Analytics alongside traffic and can be marked as a key event for reporting.

The Applications Involved

Foundation CMS (Foundation CMS) holds the measurement ID as a site setting, draws the tag on every page and sends the lead event when a form is accepted.

Google Analytics (Google Analytics) receives page views and leads, and reports on them.

How the Integration Works

An administrator enters the measurement ID in the site's tracking settings. From then on, every page carries Google's tag, but it only loads after a visitor accepts analytics cookies in the privacy box, and it runs in consent mode. When that visitor submits a form and the submission is accepted, the site sends generate_lead to Analytics. Clearing the setting removes the tag; nothing else needs undoing.

Immediate Operational Value

Analytics is live in the time it takes to paste an ID, and enquiries are counted from day one. Because the tag belongs to the site rather than to a pasted snippet, it cannot be duplicated by accident, broken by a page edit or forgotten on a new template.

Security, Access, and Governance

Foundation CMS sites carry a privacy box that every visitor sees until they decide. Essential cookies are always on; analytics and marketing tags load only after a yes, and turning the box off means no optional scripts at all. The ID field only accepts a valid measurement ID, so a typo is caught before it reaches the site. Only administrators can change tracking settings, and editors writing content never touch them.

Summary

Paste a measurement ID and a Foundation CMS site reports its traffic and its enquiries to Google Analytics 4, behind its own privacy box, with no tracking code to maintain.

Frequently asked questions

Do I need Google Tag Manager?

No. The site draws the Analytics tag itself from the measurement ID, so there is nothing to paste or manage.

Are form enquiries tracked?

Yes. A successful form submission is sent as a generate_lead event, which you can mark as a key event in Analytics.

Does Analytics load before consent?

No. It loads only after a visitor accepts analytics cookies in the site's privacy box, and runs in consent mode.

How do I switch it off?

Clear the measurement ID in the site's settings and the tag is gone from every page.

Want Foundation CMS and Google Analytics
wired up for you?