Set Up GA4 in SGEN via Tracking Consent
How to connect Google Analytics 4 to your SGEN site and verify data is flowing
Google Analytics 4 (GA4) is Google's current analytics platform. It replaces Universal Analytics, uses an event-based data model, and integrates with Google Ads for conversion-based bidding. Most sites that run marketing campaigns need it running correctly.
SGEN connects GA4 through Tracking Consent — the platform module that governs all third-party tracking scripts on your site. The setup is a single field: your GA4 measurement ID. Paste it in, save, verify in GA4 Realtime that events are arriving, and confirm that the consent banner controls what fires. That sequence is what this guide covers.
The examples use SGEN's own site as the reference — a GA4 property tracking traffic, form submission conversions, and product page engagement. This guide builds that connection from scratch and verifies it is working before any campaign traffic lands.
What is this for?
Tracking Consent is the SGEN module that manages third-party tracking scripts — including GA4 — and the consent banner that governs them. When a visitor interacts with the consent banner, Tracking Consent controls which scripts fire. When you enter a GA4 measurement ID in Tracking Consent, SGEN loads the GA4 script and fires the standard page_view event on every page load for consenting visitors.
Use this guide when:
- You are setting up a new SGEN site and need GA4 running before launch.
- You inherited an existing SGEN site where GA4 is not yet connected.
- GA4 was previously connected but stopped receiving data and you need to re-verify the configuration.
- You migrated from Universal Analytics and need to confirm the GA4 property ID is in place (UA is retired — if you see a UA-XXXXXXXXX ID in your settings, replace it with the GA4 measurement ID).
Good use cases
Pre-launch GA4 setup. Connect GA4 before the first real visitor arrives. GA4 Realtime will show zero events until traffic lands, but having the connection verified means no gap in your data from day one.
Campaign readiness. Google Ads requires a linked GA4 property to run conversion-based bidding. Before launching any paid campaign through Google, confirm GA4 is receiving data from SGEN and that the conversion events you plan to bid on are firing correctly.
Consent-aware tracking. SGEN's Tracking Consent module runs the consent banner automatically. Visitors who decline tracking are not tracked by GA4 — the script does not fire for them. This behavior is automatic once GA4 is connected through Tracking Consent rather than through a manual script.
Multi-property setup. If your account manages multiple SGEN sites and you have a GA4 property per site, each site's Tracking Consent panel holds its own measurement ID. There is no global cross-site GA4 setting in SGEN — each site is independent.
What NOT to use this for
- Google Tag Manager as the GA4 deployment method.
This guide covers the direct measurement ID path through Tracking Consent. If your organization uses GTM to manage tags centrally, the GTM container ID goes into Tracking Consent instead of the GA4 measurement ID directly. Do not enter both — pick one path and use it consistently.
- GA4 for internal traffic analysis.
GA4 counts visits from your own team unless you filter them out. Configure an internal traffic filter in GA4 (Admin → Data Streams → Configure tag settings → Define internal traffic) after verifying the connection works.
- Replacing SGEN's built-in Analytics.
SGEN Analytics and GA4 serve different purposes. SGEN Analytics is the platform's operational signal layer — it always fires and respects consent state. GA4 is for marketing attribution, Google Ads integration, and cross-channel analysis. Most sites run both.
How this connects to other features
- Track Conversions — after GA4 is connected, define the conversion events you want to measure and report on.
- How to Use SGEN Analytics — SGEN's built-in analytics runs alongside GA4.
The two systems track different things and do not interfere with each other.
- Tracking Consent — the module where GA4 is configured in SGEN.
All third-party scripts that the consent banner governs live here, not in Custom Codes.
- Custom Codes — do not use Custom Codes to load GA4.
Scripts loaded through Custom Codes bypass Tracking Consent and fire for all visitors regardless of consent state. This creates compliance exposure and data inflation. Use Tracking Consent for GA4.
Before you start
You have a GA4 property created. Log in to Google Analytics at analytics.google.com. If your property is new, create it: Admin → Create → Property. Choose "Web" as the platform. After creation, the property's measurement ID (format: G-XXXXXXXXXX) appears in Admin → Data Streams → your stream → Measurement ID.
You have admin access to SGEN. Tracking Consent is accessible to users with admin-level access on the SGEN account.
You know whether your site uses GTM or direct measurement ID. If your organization uses Google Tag Manager, you already have a GTM container ID (format: GTM-XXXXXXX). In that case, enter the GTM container ID in Tracking Consent instead of the GA4 measurement ID, and manage GA4 inside GTM. This guide covers the direct GA4 path.
GA4 Realtime is open in another tab. During verification (Step 6), you will need GA4 Realtime open. Log in to Google Analytics, select your property, and open Reports → Realtime before starting the SGEN configuration.
Where to go
Navigate to SG-Admin → Tracking Consent. The Tracking Consent panel manages the consent banner configuration and all third-party tracking integrations.
How to set up GA4 in SGEN
Steps — Connect GA4 through Tracking Consent
1. Locate the GA4 measurement ID in Google Analytics
Open Google Analytics at analytics.google.com. Select the property for this SGEN site. Navigate to Admin → Data Streams. Click the web stream for this site. The measurement ID appears at the top of the stream detail panel, in the format G-XXXXXXXXXX.
Copy the measurement ID exactly. The G- prefix is part of the ID and must be included. A common error is copying only the numeric portion — the full string including G- is required.
2. Open Tracking Consent in SGEN
In SG-Admin, navigate to Tracking Consent. Locate the Google Analytics 4 section. It will show either a blank measurement ID field (not yet configured) or the currently active ID (if a previous configuration exists).
3. Enter the measurement ID
Paste the measurement ID into the GA4 Measurement ID field. Confirm the field shows the full value including the G- prefix.
4. Confirm the consent trigger setting
Check the Trigger on consent setting. The standard setting for most sites is Analytics cookies accepted — GA4 fires only after a visitor has accepted the analytics cookie category in the consent banner.
If your site is not subject to cookie consent requirements (for example, a private internal tool or a site with a legitimate interest basis verified by legal counsel), you may set this to Always. For any site with visitors in the EU, UK, or other consent-regulated jurisdictions, keep it set to Analytics cookies accepted.
A visitor who dismisses the banner without accepting analytics will not be tracked in GA4. SGEN respects that automatically — no additional configuration is needed.
5. Save and publish
Click Save. SGEN saves the measurement ID and updates the tracking configuration on the live site.
The GA4 script begins loading on page views for consenting visitors immediately after save. There is no cache flush required.
6. Verify in GA4 Realtime
Open GA4 in another browser tab. Navigate to Reports → Realtime. The Realtime report shows events arriving at GA4 in the last 30 minutes.
In a separate browser window (use an incognito window to simulate a visitor who is not logged in to GA4), navigate to your SGEN site. If the consent banner appears, accept analytics cookies. Then navigate to two or three pages on the site.
Return to GA4 Realtime. Within 30 seconds to two minutes, you should see:
- Active users counter showing at least 1.
- Event count by event name showing
page_viewevents. - The page titles or paths you visited listed under the page dimension.
Seeing page_view events in Realtime confirms:
- SGEN is loading the GA4 script correctly.
- The measurement ID matches the GA4 property.
- The consent flow is working — the visitor accepted and GA4 fired.
7. Verify consent-mode behavior
Test the consent path explicitly.
Open a new incognito window and navigate to the site. When the consent banner appears, click Decline or Reject all (the exact label depends on your banner configuration). Navigate through two or three pages.
Return to GA4 Realtime. You should not see any new page_view events from this session. If GA4 is correctly wired through Tracking Consent, declining analytics consent prevents the script from firing.
If you do see events from the declined session, check whether GA4 is also loaded via Custom Codes or any other path outside Tracking Consent. A duplicate script load outside the consent gate will fire regardless of consent state. Remove the duplicate.
What success looks like
When GA4 is correctly connected through Tracking Consent:
- GA4 Realtime shows
page_viewevents within two minutes of a consenting visitor navigating the site. - Declining the consent banner prevents GA4 events from firing.
- The Tracking Consent panel in SG-Admin shows GA4 as active with the correct measurement ID.
- No duplicate GA4 script is loaded via Custom Codes or any other path.
- The GA4 property's Data Streams panel shows data arriving (may take 24 hours to appear in non-Realtime reports).
What to do if it does not work
GA4 Realtime shows no events after accepting consent and navigating the site.
Check the measurement ID in Tracking Consent. Confirm it matches the Measurement ID shown in GA4 → Admin → Data Streams exactly, including the G- prefix. A single character mismatch routes events to a different property or nowhere.
Clear the incognito window, accept consent again, and wait two full minutes before checking Realtime. GA4 Realtime has a processing delay of up to 60 seconds.
Confirm that GA4 is enabled in the Tracking Consent panel — the Enable GA4 toggle must be on.
Events fire even when consent is declined.
A second GA4 script is loading outside Tracking Consent. Check Custom Codes in SG-Admin for any gtag.js or analytics.js script entries. Remove them. Also check whether a GTM container is active and loading GA4 inside GTM — if GTM is configured to fire GA4 without consent conditions, it will bypass Tracking Consent's gate.
The measurement ID format looks wrong.
GA4 measurement IDs always start with G- followed by alphanumeric characters. If the field in Tracking Consent contains a UA-XXXXXXXXX format ID, that is a Universal Analytics property ID. UA is retired. Create a new GA4 property in Google Analytics and use the GA4 measurement ID.
GA4 Realtime shows events but non-realtime reports show no data after 48 hours.
Realtime confirms the connection is working. Standard reports process data with up to a 24-48 hour delay for aggregated views. If Realtime works, the standard reports will populate. If after 72 hours standard reports still show no data, check whether data retention settings in GA4 are set correctly (Admin → Data Settings → Data Retention → minimum 2 months).
Example scenarios
Example 1: Pre-launch setup for a new site. The site is three days from launch. The GA4 property is created, the measurement ID is pasted into Tracking Consent, and verification is completed in under ten minutes. When the site launches, GA4 has a full data history from day one. The first campaign — a Google Ads search campaign — launches a week after the site and uses GA4 conversion data from the first seven days as its baseline.
Example 2: Re-connecting GA4 after a site migration. A site migrates from a different CMS to SGEN. The old GA4 setup used a manually embedded script. On SGEN, the script path changes: the measurement ID goes into Tracking Consent, the manual script in Custom Codes is removed. Realtime confirms events are flowing. The GA4 property's historical data is preserved — SGEN sends events to the same property, not a new one.
Example 3: Consent-mode verification before a GDPR-regulated campaign. An EU campaign is launching next week. Before turning on ad spend, the marketing lead verifies consent-mode behavior using the test in Step 7: one incognito session accepts, one declines. Realtime confirms that declining prevents GA4 from firing. The campaign proceeds with confidence that the tracking setup meets consent requirements.
Common questions
Does connecting GA4 through Tracking Consent affect SGEN Analytics? No. SGEN Analytics and GA4 are independent. SGEN Analytics fires its own event layer regardless of GA4 state. The two do not interfere with each other and do not share data.
Should I use GTM or the direct measurement ID? Either works. The direct measurement ID path (this guide) is simpler to set up and maintain if your only tracking need is GA4. GTM is the better path if you need to manage multiple tags centrally, use GA4 alongside other tracking pixels, or need conditional firing logic that goes beyond consent state. Do not use both paths simultaneously for GA4 — you will double-count events.
Will GA4 track visitors who use an ad blocker? Ad blockers that block GA4's script will prevent tracking regardless of consent state. This is a known limitation of client-side tracking. GA4's server-side measurement protocol can partially address this; that configuration is outside the scope of this guide.
How do I link GA4 to Google Ads? In Google Analytics: Admin → Google Ads Links → Link. SGEN does not manage this link directly — it is a property-level configuration in Google Analytics. Completing this link enables conversion import from GA4 into Google Ads. See Track Conversions for defining the conversion events that flow through this link.
Can I connect multiple GA4 properties to one SGEN site? Standard Tracking Consent configuration supports one GA4 measurement ID per site. If your use case requires multiple properties (for example, a rollup property alongside a site-specific property), use GTM to load both and enter the GTM container ID in Tracking Consent.
Related reading
- Track Conversions — define conversion events after GA4 is connected
- How to Use SGEN Analytics — SGEN's built-in analytics alongside GA4
- Route Form Submissions — form submissions as conversion events in GA4
