Reference → Connect Google Analytics to your site

Connect Google Analytics to your site

How to install GA4, add Google Tag Manager if needed, gate measurement by consent, map events to site actions, and confirm data is flowing.

Google Analytics is how the team sees what visitors are doing on the site.
Connecting it cleanly — once, with consent gating and event mapping in place — is what turns analytics from a noisy raw feed into a useful operating surface.
This page walks the full analytics setup workflow for an SGEN site — installing the GA4 measurement tag, adding Google Tag Manager when the team wants more flexibility, gating measurement by visitor consent, mapping site actions onto GA4 events, running the GA4 debug mode to confirm data is flowing, and clearing the analytics view when something needs to be re-installed.

The page is written for two operating modes.
The first is fresh installation — the site has no analytics today and the team wants a clean install from the start.
The second is migration — the site has an existing analytics setup that needs to move to GA4 or to incorporate consent gating retroactively.
Both modes share the same surface, and the discipline is the same — install, gate, map events, run debug mode to verify, monitor.

What is this for?

Use this page when you want to measure how visitors use the site.
The Analytics integration covers GA4 — Google's current analytics product — and Google Tag Manager as an optional layer for teams that want more flexibility around what gets measured.

The page is a how-to.
It does not teach how to read GA4 reports or how to build a reporting practice — those topics live in Google's own documentation.
It does not promise specific metrics; analytics measures what visitors do, not what visitors think.
The page focuses on getting the data flowing correctly so the team can build reports against trustworthy data.

Good use cases

  • A new site launch where analytics needs to be in place from day one so the team has baseline measurements.
  • A site migrating from a previous analytics product to GA4.
  • A team adding consent gating to an existing analytics setup to align with regulatory requirements.
  • A site that wants to measure custom actions — form submissions, video plays, file downloads — beyond the default pageview tracking.
  • A multi-site portfolio that needs consistent analytics setup across every site.

What NOT to use this for

  • Hosting the GA4 property itself. The GA4 property lives in your Google Analytics account, not in SGEN. SGEN installs the measurement tag on the site; the data lands in Google's storage and is viewed through the GA4 surface.
  • Aggregating data across many sites in one GA4 view. For cross-site reporting, use GA4's own roll-up properties or a dedicated reporting tool. SGEN installs per-site tags; the cross-site view is built in GA4.
  • Replacing search console data. GA4 measures on-site activity; the search console measures how the site appears in search. The two surfaces complement each other; neither replaces the other.
  • Storing personally identifiable information about visitors. GA4 has its own rules about what may be measured, and SGEN's installation respects those rules. Custom events should not pass personal information.

How this connects to other features

  • Optimize for SEO — analytics and SEO read the same audience from two angles; analytics confirms whether organic traffic is converting.
  • Set up a custom domain — the measurement tag fires on whichever domain the site serves on; a domain change can affect how data appears in GA4 reports.
  • Publishing Lifecycle — every publish event creates a new measurable surface; tying publishes to analytics events helps measure content performance.
  • Audit Log — every analytics install action, consent-gating change, and event-mapping edit is recorded; use the log to confirm changes.

Before you start

  • You have a Google Analytics account with a GA4 property created. If you do not, create one in the Google Analytics surface; the GA4 property gives you a Measurement ID that looks like G-XXXXXXXXXX.
  • You are signed in as a user with site-admin permission for the SGEN site. The Analytics surface is locked to admin-level users because it touches every page render.
  • For consent gating, the team has agreed on the consent posture — opt-in by default, opt-out by default, regional variations, or a mix. The decision belongs to the team's privacy review, not to SGEN.
  • For Google Tag Manager, you have a GTM container created in the GTM surface and you have the container ID — it looks like GTM-XXXXXXX.
  • The site is reachable on its public domain. The analytics tag fires on the public surface; while the site is private or in pre-launch, measurement data will be limited.

Where to find it

The per-site surface is the admin → Integrations → Analytics inside the site you are setting up.
This surface holds the GA4 tag installation, the GTM container reference if used, the consent-gating settings, and the event-mapping panel.

The portfolio surface is SG-Dashboard → Site Manager → Analytics at the account level.
This surface lists every site's analytics status — installed, consent-gated, data flowing — and surfaces sites that are missing setup steps.

For data review, the GA4 surface itself — at analytics.google.com — is where reports are read.
The SGEN side installs the tag; Google's side stores and shows the data.

Steps

The workflow has seven parts — install GA4, add GTM if used, set up consent gating, map events to actions, run debug mode, confirm data is flowing, and adjust over time.
The steps below cover the per-site surface.

1. Install the GA4 measurement tag

Open the site in the admin.
Click Integrations in the left navigation.
Click Analytics in the integrations list.

The Analytics panel opens with the current installation status. For a fresh site the status reads Not Installed.

Click Install GA4.
The install panel opens with one required field — the Measurement ID.

Open your Google Analytics account in another tab.
Open the GA4 property for the site.
Open Admin → Data Streams → Web and find the data stream for the site.
Copy the Measurement ID — the string starting with G-.

Return to SGEN and paste the Measurement ID into the field.

Pick the Tag scopeAll pages for normal use, Public pages only to exclude admin-facing pages from measurement.
Most installations use All pages; the Public pages only scope is for sites where admin activity should not appear in audience reports.

Pick the Send page_view automatically option — usually on.
The default page_view event is the foundation of every GA4 report; leave it on unless you have a specific reason to suppress it.

Click Save Installation.
The status changes to Installed — Awaiting Data. The measurement tag is now in place on every render of the site.

For most sites the first data lands in GA4 within a few minutes.
The status flips to Installed — Data Flowing once the platform confirms tag fires from at least one real visitor.

2. Add Google Tag Manager when more flexibility is needed

For teams that want to manage many measurement tools from one surface, Google Tag Manager is a useful layer.
GTM holds the tag configurations; SGEN holds the GTM container reference and ensures it loads on every page.

Click Add GTM in the Analytics panel.
Enter the GTM container ID — the string starting with GTM-.

Pick the Container loading mode.
The standard mode loads GTM on every page; the deferred mode delays the container until after first interaction.
Most teams use the standard mode; deferred mode is useful for sites where the GA4 tag itself fires from inside GTM and a fast time-to-data is less important than initial page performance.

Click Save Container.
The container appears in the panel with status Active.

With GTM in place, the GA4 tag can be configured either directly through the SGEN Install GA4 step or through GTM as a managed tag.
Pick one path and stay with it; running the same GA4 tag from both surfaces produces duplicate page_view events that confuse reports.

If GA4 is being moved into GTM management, switch off the Send page_view automatically option in the SGEN install panel after the GTM-managed GA4 tag is verified to be firing.
The Audit Log records both the switch-off and the GTM container addition for traceability.

3. Set up consent gating

Click Consent Gating in the Analytics panel.
The consent panel shows the current posture and the surfaces involved.

Pick the Default postureOpt-in, Opt-out, or Region-aware.
Opt-in measures no visitors until they accept; opt-out measures every visitor until they decline; region-aware switches between the two based on the visitor's region.

For a region-aware setup, the regional rules use the visitor's region as detected at the edge.
Regions covered by stricter privacy regulations default to opt-in; other regions default to opt-out.
The region table is maintained by SGEN and updated as regulations change; the panel surfaces the current table for review.

Pick the Consent banner.
The platform's built-in banner is a sensible default that meets most regulatory baselines.
For a custom banner — built by the team or provided by a consent management partner — pick External banner and supply the banner's consent-signaling configuration.
The custom-banner setup needs the banner to signal consent state to the platform in a documented shape; the panel surfaces the shape.

Pick Categories the consent banner covers — usually Analytics, Marketing, and Functional.
The Analytics category is the one that gates the GA4 tag.
Other categories gate other tags such as marketing pixels or functional cookies; the categories the site uses depend on the other integrations attached.

Click Save Consent Gating.
The consent layer becomes active on the next render.
Visitors see the banner on first visit and the GA4 tag fires only when consent is granted for the Analytics category.

The consent state is stored locally with the visitor and respected across visits until the visitor changes their preference.
The consent banner has a Manage preferences link that lets visitors update their state at any time.

4. Map site actions to GA4 events

Click Event Mapping in the Analytics panel.
The mapping panel lists site actions that the platform can measure — form submissions, button clicks on tagged components, video plays, file downloads, scroll depth milestones, outbound link clicks.

For each action that should be measured, click Add Mapping.
Pick the action from the dropdown.
Pick the GA4 event name — either a standard GA4 event like form_submit or file_download, or a custom event name the team has agreed on.

Add Parameters if the event should carry context.
A form_submit event might carry the form name as a parameter; a file_download event might carry the file path.
Parameters are limited to non-personal data; the panel rejects parameter names that look like they might carry personal information.

Click Save Mapping.
The mapping appears in the list with status Active.

For complex event tracking — events that need to fire conditionally based on data on the page — use the GTM path.
GTM's trigger and variable system handles conditional firing better than the SGEN event-mapping panel; the SGEN panel covers the everyday cases without needing GTM.

The most common event mappings — form_submit on contact forms, file_download on PDF and brochure links, video_play on embedded video — cover the majority of measurement use cases for most sites.
Mapping these on launch day gives the team a useful baseline of activity to track against.

5. Run GA4 debug mode to verify

GA4 has a built-in debug mode that shows tag fires in near-real-time during testing.
Use debug mode to confirm the install is firing correctly before relying on the data.

In the GA4 surface, open Admin → DebugView. The DebugView panel shows debug-flagged tag fires across the property.

In SGEN, return to the Analytics panel and click Enable Debug Mode.
Debug mode adds a debug parameter to every tag fire originating from your test session.
Debug mode is session-scoped — only your current browser session is flagged; live visitor data is not affected.

Open the public site in your browser.
Browse a few pages.
Submit a form, click a tagged button, play a video — actions that should fire events.

Return to the GA4 DebugView surface.
Confirm the page_view events appear in the panel as you navigate.
Confirm the mapped events appear as you trigger them — each event named correctly, with the expected parameters.

If a mapped event is missing from DebugView, check the event mapping in SGEN, confirm the action selector matches the live page, save the mapping again, retry the action.

When the debug session is complete, return to SGEN and click Disable Debug Mode.
Debug mode auto-disables after a session timeout if the operator forgets to switch it off; the timeout default is one hour.

6. Confirm data is flowing in GA4 reports

Open the GA4 surface at analytics.google.com.
Open Reports → Realtime for the property.

The Realtime view shows visitors and events from the last thirty minutes.
With at least one or two real visitors on the site, the view should show pageviews, the pages being viewed, and any mapped events firing.

If the Realtime view shows no data after debug mode confirmed the tag is firing, the most common cause is consent gating — the test session may have declined consent.
Open the site in a fresh browser window, accept consent, and the tag should fire.

Open Reports → Engagement → Events for the property.
After twenty-four hours, this report shows the full event list — page_view, plus any mapped custom events.
Confirm the mapped events appear with sensible counts; events that should fire often but show zero counts in the report deserve a debug-mode re-check.

For a launch report to stakeholders, the GA4 surface is where the data lives; the SGEN side confirms the data is flowing.
A clean install produces a steady baseline of pageviews and events from the first day live.

7. Adjust event mappings and consent posture over time

Analytics is not a one-time setup.
As the site grows, new actions become worth measuring; as regulations evolve, the consent posture may need to change.

Open the Analytics panel monthly.
Walk the event mapping list.
Add mappings for new actions that have become important; remove mappings for actions that no longer matter.

Walk the consent gating settings.
Confirm the posture still matches the team's privacy policy and regulatory environment.
Regulatory changes happen on their own cadence; the privacy team typically signals when a consent posture change is needed.

Open the SGEN Audit Log filtered to Analytics events to confirm the install's history reads cleanly.
Every change should have a clear actor and a clear reason.

For a multi-site portfolio, repeat the walk per site or use the portfolio surface for a faster aggregate review.

A monthly walk takes fifteen minutes per site and prevents analytics drift — the scenario where the team realizes six months later that an important action was never being measured.

What success looks like

A GA4 install is set up correctly when the Analytics panel shows status Installed — Data Flowing, the GA4 Realtime view shows pageviews from real visitors, the Audit Log carries the install action with a clear actor, and the event mappings cover the actions the team cares about measuring.

Consent gating is in place when the consent banner appears on first visit, the GA4 tag fires only after consent is granted, the consent state is remembered across visits, and the Audit Log records the consent posture choice.

A clean event mapping is one where every important on-site action has a corresponding mapped event, the event names follow a consistent convention, every event carries the parameters the team needs for reporting, and the GA4 Events report shows steady event counts that match site activity.

What to do if it does not work

SymptomLikely causeFix
Status reads Installed — Awaiting Data after several daysTag is installed but no visitors are reaching the site, or consent gating is blocking the tagConfirm the site has real visitors; open the site in a fresh browser window, accept consent, and check Realtime view
Realtime view shows pageviews but no eventsEvent mappings have not been saved, or the action selectors do not match the live pageOpen the Event Mapping panel; confirm each mapping is Active; re-test in debug mode
Events firing twice in GA4GA4 tag is installed both via SGEN direct install and via a GTM-managed tagPick one path; switch off Send page_view automatically in SGEN if GA4 is being managed through GTM
Consent banner not appearing on the siteConsent gating is set to Opt-out with the banner suppressedOpen Consent Gating; confirm the banner is enabled; save again
Debug mode shows fires but live reports do notDebug fires are recorded separately in GA4 for testing onlyDisable debug mode; re-test as a real visitor; check Realtime view
GTM container loads but no tags fireThe GA4 tag inside GTM is not configured to fire on the right triggerOpen the GTM container; confirm the GA4 tag has a Page View trigger or All Pages trigger
Event parameter rejected at saveParameter name matches a reserved or personal-information patternRename the parameter to something that does not look like a personal identifier
Reports show traffic from your own teamInternal traffic is not being filteredSet up internal traffic filters in GA4 using the team's IP address ranges or a custom filter parameter

Examples

Example A — fresh GA4 install on launch day.
A team is going live on a new site.
Operator opens the admin → Integrations → Analytics, clicks Install GA4, pastes the Measurement ID from the GA4 surface, picks All pages scope, saves.
Opens Consent Gating, picks Region-aware posture with the built-in banner.
Opens Event Mapping, adds mappings for the three contact forms on the site (form_submit with form name parameter) and the PDF download link in the resources section (file_download with file path parameter).
Runs debug mode, confirms every mapped event fires correctly.
Within an hour of launch, the GA4 Realtime view shows a steady baseline of pageviews.

Example B — migration from a legacy analytics product.
A site has been running on a legacy analytics product.
Operator installs GA4 alongside the existing setup, lets both run for two weeks for comparison, confirms GA4 data matches the legacy data within an acceptable margin, then removes the legacy tag.
The two-week parallel period confirms the new install is producing trustworthy data before the team commits to it.

Example C — adding consent gating retroactively.
A site has had analytics running without consent gating because the original audience was outside the strict regulatory regions.
The site has now expanded into Europe and the team needs to add consent gating.
Operator opens Consent Gating, picks Region-aware posture, picks the built-in banner.
The next render adds the banner; European visitors see opt-in by default, other regions continue opt-out.
GA4 data from European visitors becomes consent-gated; data from other regions continues as before.

Example D — GTM-managed analytics for a portfolio.
An agency runs twenty client sites and wants consistent analytics across all of them managed through GTM.
Operator sets up a master GTM container template, adds GTM to each SGEN site with its client-specific container ID, configures the GA4 tag inside each container against the client's GA4 property.
The SGEN-direct GA4 install is left off on every site; GTM is the single tag-management surface.
Updates to measurement rules now happen in GTM and propagate across the portfolio.

Example E — adding a video play event mapping.
A site adds a video to the home page and the team wants to measure how many visitors play it.
Operator opens Event Mapping, adds a mapping for Video play on hero block, names the GA4 event video_play with parameters for the video title and the play position.
Runs debug mode, plays the video, confirms the event fires with the expected parameters.
Twenty-four hours later the GA4 Events report shows a baseline of video play counts the team can track over time.

Common questions about analytics setup

Do I need GTM to use GA4 with SGEN?
No.
The SGEN Analytics surface installs GA4 directly with no GTM required.
GTM is useful when you have many measurement tools to manage or when you want more flexibility around when tags fire.
For a clean GA4-only setup, the direct install path is the lighter choice.

Does consent gating slow the site down?
The consent banner adds a small amount of JavaScript that runs on first visit.
The platform's built-in banner is light enough that it does not show up as a measurable performance hit on typical sites.
Custom banners from third parties vary; the team should confirm performance impact when integrating an external banner.

What happens to GA4 data when a visitor declines consent?
With consent declined, the GA4 tag does not fire for that visitor.
No pageviews, no events, no data lands in GA4 for the visitor.
The visitor can change their preference at any time using the Manage preferences link in the banner.

Can I measure events without GA4 — using SGEN's own analytics?
SGEN's built-in analytics measures basic pageview activity for every site.
For detailed event measurement — custom events, parameters, audiences, conversion tracking — GA4 is the right surface.
The built-in view answers questions like "how many pageviews did the site get yesterday"; GA4 answers questions like "which campaign source produced the highest conversion rate on the contact form".

Does GA4 work on staging environments?
The GA4 tag fires on whichever surface the site serves on, including staging.
For most teams, staging traffic should be filtered out of the GA4 reports — use GA4's internal traffic filter or a separate GA4 property for staging.

How long is GA4 data retained?
GA4 data retention is set in the GA4 property settings, not in SGEN.
The default in GA4 is two months for event-level data; the property can be set to retain up to fourteen months.
Aggregate reports are retained for longer per GA4's own policy.

Plan for large-site, enterprise, and multi-site analytics scenarios

A large site, an enterprise account, or a multi-site portfolio raises the analytics operational stakes.
The mechanics stay the same; the discipline changes.

Large single-site planning

A site with high traffic and many measured actions accumulates a lot of event data quickly.
Use the GA4 surface's data sampling settings carefully — too high a sample rate produces noisy reports; too low a sample rate misses important small-segment behavior.

For a site with regulated content or sensitive audiences, pair the consent gating with a clear privacy policy that names what is measured and how the data is used.
The privacy review cycle should touch the analytics setup at least once a year.

For a site with many event mappings, document each mapping in the team's internal runbook — the action it represents, the GA4 event name, the parameters carried, and the reports the event feeds.
A documented event taxonomy prevents naming drift — two team members adding the same event under different names.

Multi-site portfolio planning

For an agency or in-house team running many sites, the portfolio surface in SG-Dashboard is the right lens.
Open SG-Dashboard → Site Manager → Analytics for a single roll-up of every site's analytics status, the consent posture per site, and the event mapping count per site.

Pick a portfolio cadence and write it down.
A typical agency cadence — monthly walk of the portfolio Analytics surface to catch sites with stale or missing setup, quarterly review of event mappings per site to add new actions and retire old ones, annual review of consent posture against the current regulatory landscape.

Standardize the consent banner across the portfolio.
A single banner approach — same wording, same posture rules, same look — lifts every site at once and reduces the per-site review surface.

For an enterprise account, pair analytics with the BI and reporting stack.
GA4 has a BigQuery export that lifts the data into the team's data warehouse; once in the warehouse, analytics joins the rest of the operational data and supports cross-source reporting.

A documented portfolio playbook for analytics — install, consent posture, event taxonomy, debug and verification — turns the per-site setup into a process that takes thirty minutes per site rather than half a day of bespoke work.

Event taxonomy and naming conventions

For sites with many events, a clear naming convention prevents the same action being measured under two different names across two pages of the same site.

Pick a convention up front and document it.
A common pattern — verb_noun for the event name (submit_form, download_file, play_video), with parameters carrying the noun's identifier (form_name, file_path, video_title).
The convention reads cleanly in GA4 reports and groups related events together.

For a portfolio, share the convention across every site.
A team member moving between sites can read the events on each site without re-learning the naming.
The portfolio reports — built across many sites — become trustworthy because the events line up.

Resist adding events that are not yet tied to a report.
Every event adds noise to GA4; an event that no one reads adds noise without a benefit.
The rule of thumb — add the event when the report that consumes it is being built, not in advance.

Server-side measurement for stricter privacy regions

For regions with stricter privacy requirements, server-side GA4 measurement is a useful complement to the standard client-side tag.
Server-side measurement runs in your own infrastructure rather than in the visitor's browser; the visitor's browser is not asked to send measurement directly to Google.

Server-side measurement is more involved than the standard tag install.
It requires a Google Cloud project running the server-side GTM container, a tagging server that receives events from the site and forwards them to GA4.
SGEN supports server-side measurement through the GTM integration; the heavy lifting is in the tagging server setup.

For most sites the standard client-side tag with consent gating is the right balance of measurement quality and operational simplicity.
Server-side measurement is the right move when the privacy posture demands it or when the team has the engineering capacity to operate the tagging server reliably.

If server-side measurement is on the roadmap, plan the rollout in two phases — phase one runs both client-side and server-side in parallel for verification, phase two retires the client-side tag once the server-side measurements match.
The two-phase approach prevents a measurement gap during the switch.

Related reading

On this page