Analytics and consent integration · Updated November 15, 2026
Google Analytics 4 integration
Google Analytics 4 records what people do on your site as events, and the important ones, like a donation or a booked call, become key events. We set up GA4 on WordPress, Webflow, Astro, Next.js or custom software, with consent mode wired to your cookie banner and server events where the browser can't see the result.
Google Analytics 4 at a glance
- Connects
- The Google tag or Tag Manager in the browser, the Measurement Protocol from servers, BigQuery export and Google Ads.
- WordPress
- Site Kit, Google's official plugin, places the tag. Consent mode also needs the WP Consent API plugin and a banner plugin.
- Webflow
- A native Measurement ID field or Google's site tools app. No built-in banner holds GA4 until consent.
- Astro or Next.js with Sanity
- A layout component loads the tag; server routes send key events through the Measurement Protocol.
- Custom software
- Measurement Protocol calls from your backend, tied to the browser's client ID.
- Complexity
- Medium. The tag is quick; consent and clean key events take the time.
- Typical setup
- 1 to 2 days for the tag, key events and consent mode, 3 to 6 days with server events and BigQuery export.
How we connect Google Analytics 4
WordPress
We use Site Kit by Google, which places the Google tag without theme edits. Its consent mode setting needs the WP Consent API plugin plus a supported banner plugin, such as Complianz or CookieYes. Site Kit's docs describe tracking off by default only for the EEA, Switzerland and the UK, so we set the Canadian default in the banner plugin.
Webflow
Webflow's Google Analytics field takes a GA4 measurement ID and, as of November 15, 2026, routes the tag through Google tag gateway on your own domain. Webflow's own consent settings gate only Webflow Analyze and Optimize, so GA4 needs a consent app or our own banner. We keep the ID in one place so the tag loads once.
Astro or Next.js with Sanity
In Next.js we use the GoogleAnalytics component from @next/third-parties, which the Next.js docs still mark experimental, or load GA4 through Tag Manager. In Astro the base layout loads it. Key events that finish on the server, like a paid registration, go from an API route through the Measurement Protocol with the visitor's client ID.
Custom software
Your backend sends events to the Measurement Protocol with an API secret that never reaches the browser. Google says the protocol adds to the tag rather than replacing it. Each request carries up to 25 events, timestamps can go back 72 hours, and a property fed only from a server gets partial reports.
What organizations use Google Analytics 4 for
Key events
GA4 calls important actions key events and saves the word conversion for those used in Google Ads. We mark one or two per goal, such as a completed gift, and fire them when the action is confirmed.
Consent mode v2
Consent mode sends Google four signals: ad_storage, analytics_storage, ad_user_data and ad_personalization. In basic mode the tag waits for the banner and sends nothing on refusal. In advanced mode it loads first and sends cookieless pings while consent is denied. We set up whichever one your privacy policy describes.
Raw data in BigQuery
Standard GA4 properties can export up to 1 million events a day to BigQuery. Google bills BigQuery storage and queries past the free sandbox, and streaming export adds US$0.05 per GB as of November 15, 2026.
What to watch out for
Modelling needs volume
GA4 only models visitors who refused consent once a property logs 1,000 denied events a day for 7 days and has 1,000 consented daily users on 7 of the last 28 days. Below those numbers there is no modelling, so reports show only people who said yes.
Short retention
Explorations and funnel reports keep user-level data for 2 or 14 months on standard properties. Standard reports aren't affected. We set 14 months at setup and add BigQuery for longer history.
Data leaves Canada
Google says GA4 sends data to its nearest collection centre, then to Analytics processing servers, and drops IP addresses before logging. It documents no Canadian storage option. Quebec's Law 25 requires a privacy impact assessment before personal information goes outside Quebec, including to a service provider like Google.
Sources
Checked against Google's Analytics and tag platform docs on November 15, 2026.
- About key events key events, June 15, 2026 change
- Consent mode overview basic and advanced, consent types
- Behavioural modelling for consent mode modelling thresholds
- Data retention
- BigQuery Export daily limit, streaming cost
- Measurement Protocol
- Send Measurement Protocol events 25 events, 72 hours
- Data collection and processing data centres, IP addresses
- Site Kit consent mode
- Webflow: connect Google Analytics Google tag gateway
- Webflow: manage site tracking consent
- Next.js third-party libraries
- Quebec private sector privacy act (Law 25) sections 8.1 and 17
- OPC guidelines on online behavioural advertising
- CRTC: CASL requirements for installing computer programs cookies and JavaScript
Questions about Google Analytics 4
Do we need consent before GA4 loads in Canada?
For Quebec visitors, Law 25 says tools that can identify, locate or profile someone must be explained up front, with a way to turn them on, so analytics cookies stay off until they agree. Elsewhere, the Privacy Commissioner's PIPEDA guidance allows opt-out for non-sensitive tracking that is plainly explained and easy to refuse.
Does CASL cover analytics cookies?
No. CASL covers commercial emails and texts, and installing computer programs. The CRTC treats cookies and JavaScript as consented to when a visitor's conduct shows they accept them. Cookie consent in Canada comes from PIPEDA and Law 25.
What changed for GA4 and Google Ads in June 2026?
Google's key events help says that on June 15, 2026, Analytics moved to consent mode in Google Ads as the single control for certain Google Ads cookie and ID data. If GA4 is linked to Google Ads, the consent your banner sends now decides what reaches Ads, so we test each consent choice in Tag Assistant.
Related integrations
Cookiebot
Cookiebot is Usercentrics' consent management platform for small and mid-sized sites, with a cookie scanner, consent banner, automatic blocking and Google Consent Mode.
Cookiebot integrationCookieYes
CookieYes is a consent management platform with a cookie scanner, banner templates, automatic and manual script blocking, and Google Consent Mode v2 support.
CookieYes integrationFathom Analytics
Fathom Analytics is a paid, cookieless website analytics service run by Conva Ventures Inc. of Victoria, British Columbia.
Fathom Analytics integrationGoogle Tag Manager
Google Tag Manager is Google's tag management system. A web container loads tags such as GA4 and the Meta Pixel in the browser; a server container runs them on infrastructure you host.
Google Tag Manager integrationMeta Pixel and Conversions API
The Meta Pixel is Meta's browser code for measuring Facebook and Instagram ads. The Conversions API is its server-to-server counterpart.
Meta Pixel and Conversions API integrationMicrosoft Clarity
Microsoft Clarity is Microsoft's free behaviour analytics tool, with session recordings, click and scroll heatmaps, and a GA4 connection.
Microsoft Clarity integrationWebsite development
Sites built with GA4 key events and consent mode in place from launch.
Website developmentSEO
SEO reporting that ties organic visits to GA4 key events.
SEONonprofit websites
Charity sites that measure gifts and sign-ups in GA4 with consent first.
Nonprofit websites
Setting up or fixing GA4?
Tell us what counts as success on your site and which cookie banner you run. We'll map the key events, consent settings and any server events you need.
Book a call