Custom Google Analytics API integration
Appfront builds custom Google Analytics 4 integrations that get the most out of GA4 while staying GDPR-compliant. From the Data API and Admin API to the Measurement Protocol for server-side tracking, Google Tag Manager client and server-side containers, Consent Mode v2 for the EEA, Enhanced Conversions for Google Ads, and the native BigQuery export. The result: reliable attribution, full data ownership via BigQuery, and a setup that passes the Dutch Data Protection Authority's scrutiny.
What is a Google Analytics API integration?
Google Analytics 4 (GA4) is the current version of Google's analytics platform and, since July 2023, the only available version following the end of Universal Analytics. GA4 is fully event-based, stores data in a columnar format and, unlike Universal Analytics, offers free native export to BigQuery, giving you full raw data access without a 360 licence.
A complete GA4 API integration consists of three layers. Collection: gtag.js or GTM on your site, supplemented by a GTM server-side container (on Cloud Run, App Engine or your own Node backend) for first-party tracking and Consent Mode v2 integration with your cookie banner. Configuration and orchestration: via the Admin API v1 you manage properties, data streams, custom dimensions, audiences and Google Ads links programmatically. Activation: via the Measurement Protocol you send server-side events, offline conversions and CRM data to GA4, and via the Data API v1beta you retrieve reports for Looker Studio, Power BI or your own dashboard.
Appfront builds in line with the official Google Analytics developer documentation and the OWASP ASVS security standard. We align the tracking architecture, consent logic and data retention with your actual marketing and compliance needs, so the integration performs well at peak volumes and meets the GDPR guidelines of the Dutch Data Protection Authority.
BigQuery export free in GA4
Where Universal Analytics offered this only in the 360 tier, GA4 lets you export all event data to BigQuery daily (or via streaming) as standard. No sampling, no row limits: full raw data with all user properties, events and item data for your own SQL analysis, Looker Studio dashboards or integration with your data warehouse.
Server-side GTM for first-party tracking
A dedicated GTM Server Container on Cloud Run, App Engine or your own backend: events first go to your infrastructure (your domain), where they are enriched and filtered, and only then to GA4, Google Ads or Meta. Less impact from ad blockers, better attribution, and control over which personal data the platforms can access at all.
Consent Mode v2 + Enhanced Conversions
Mandatory in the EEA for Google Ads users since March 2024: Consent Mode v2 signals consent status to GA4 and Google Ads so that modelled conversions are calculated correctly. Combined with Enhanced Conversions (hashed email/phone), you retain attribution quality despite consent restrictions and GDPR.
Our development process for GA4 API integrations
We work to a proven methodology that removes uncertainty early and delivers a stable GA4 setup that reassures both marketing and legal teams. From an initial analysis of your KPIs, Google Ads strategy and consent requirements through to go-live and ongoing management, every step aims for a configuration your team can read and adjust itself.
We map out which KPIs, events and conversions matter most, what role Google Ads plays, which consent flow your legal team prescribes, and whether server-side tracking or BigQuery export is needed. Result: a measurement plan and tagging architecture.
We design the integration architecture, choose the right authentication and draw up an error-handling strategy.
Implementation with automated tests, structured logging and monitoring. You see working builds along the way.
Controlled go-live with data validation and a safety net, followed by ongoing management and further development.
What a GA4 API integration delivers in practice
Every GA4 integration is set up specifically for your products, marketing stack and compliance requirements. Below are the capabilities we most often deliver for organisations using GA4 as their analytics backbone alongside Google Ads, BigQuery and Looker Studio.
gtag.js & GTM client-side
Correct implementation of gtag.js or Google Tag Manager on your site, with an event schema suited to GA4 (not a Universal Analytics legacy mapping). Enhanced measurement for scrolls and outbound clicks, form interactions, video engagement and file downloads. E-commerce events for Shopify, Magento, WooCommerce or custom shops.
GTM server-side container
Setting up a dedicated GTM Server Container on Google Cloud Run, App Engine or a custom Node backend on your domain. Events first go to your server (first-party), where they are enriched (user ID lookup, IP masking, consent enforcement) and only then sent to GA4, Google Ads, Meta and others. Lower loss from ad blockers and better privacy control.
BigQuery export & custom SQL
Activating the native GA4 BigQuery export (daily or streaming) and setting up a layered model with dbt or simple scheduled queries for funnels, cohort analyses, LTV and cross-device attribution. Dashboards in Looker Studio, Power BI or Tableau on the raw event data, without GA4 sampling limitations.
Data API dashboards
Live dashboards and reports built on the GA4 Data API v1beta (runReport, runPivotReport, runRealtimeReport), for teams who want to see their figures in their own application, intranet or Slack rather than in the GA4 interface. In Python, Node.js or Java via the official client libraries.
Consent Mode v2 + Enhanced Conversions
Connecting Consent Mode v2 to your cookie banner (Cookiebot, OneTrust, Didomi, Cookie Information or custom) so that GA4 and Google Ads modelled conversions work correctly. Enhanced Conversions (hashed email, phone, address) sent to Google Ads for reliable attribution despite consent restrictions. Offline conversions from your CRM via the Measurement Protocol.
Admin API & governance-as-code
Using the Admin API v1, we manage properties, data streams, custom dimensions, audiences and Google Ads, BigQuery and Firebase links programmatically. With governance-as-code (Terraform or bespoke scripts), your configuration stays reproducible and audit-ready, and new tracking environments can be set up in minutes rather than hours of manual clicking.
Typical use cases in practice
A GA4 API integration looks very different depending on the type of organisation. We see a number of recurring patterns, and for each of them we have a proven setup with attention to tracking architecture, consent flow, Google Ads linking and BigQuery dashboards.
E-commerce with Google Ads
Webshops on Shopify, Magento, WooCommerce or custom platforms that rely heavily on Google Shopping and Performance Max. Enhanced Ecommerce events, Enhanced Conversions for hashed customer data, server-side tracking via GTM, and attribution models in BigQuery for an accurate ROAS measurement despite ad blockers and consent gaps. See also our API integrations.
B2B SaaS & lead generation
SaaS companies and B2B service providers that generate leads through Google Ads and want a measurable sales funnel. Conversions from your product (trial starts, upgrades) sent server-side to GA4 via the Measurement Protocol, offline conversion uploads from HubSpot or Salesforce for closed-won deals, and audiences for retargeting based on BigQuery segments.
Publishers & media
Publishers, news sites, magazines and content platforms running AdSense or Google Ad Manager alongside GA4. BigQuery export for in-depth article performance, scroll and engagement by template, Google Signals for cross-device attribution, and custom Looker Studio dashboards for editorial and commercial teams.
Apps via Firebase
iOS and Android apps using Firebase, where Firebase Analytics flows automatically into a linked GA4 property. Cross-platform attribution (web + iOS + Android), deep link tracking, consistent user IDs across channels, and BigQuery export for your own churn and retention analyses in Snowflake or BigQuery ML.
Technology we use
We build GA4 integrations with the official Google Analytics Data API, Admin API and Measurement Protocol, combined with the backend stack that suits you. The precise choice depends on whether you want server-side tracking, whether you make use of BigQuery and which Google Ads features are relevant, so that your own team can manage or further develop the implementation.
Why choose Appfront for your GA4 integration?
Appfront has extensive experience building API integrations for a wide range of organisations in the Netherlands. We always start with a thorough analysis of your existing systems and processes. An integration should not only work technically, but also add practical value to the way you work.
For every integration, we write clear documentation and make sure your own team, or any future supplier, can understand and manage it. No black box, just transparent code and clear agreements on monitoring, alerting and maintenance.
You work with a dedicated point of contact who understands both the technical and the functional side. This keeps communication short, prevents misunderstandings and speeds up decisions when choices need to be made during development.
Looking for a GDPR-first alternative? See our Matomo and Piwik PRO pages. More about our wider services: API integrations, middleware, custom software and web app development.
- Experience with the GA4 Data API, Admin API and Measurement Protocol
- Specialist in GTM server-side containers on Google Cloud Run
- Familiar with Consent Mode v2, Enhanced Conversions and AP compliance
- Secure by default: API key rotation, webhook signature validation, scoped permissions
- Structured error handling and retry mechanisms
- Comprehensive logging and monitoring from day one
- Clear documentation your team can read and manage
- A fixed point of contact, no account managers passed around
- Ongoing maintenance and proactive further development
- A way of working aligned with your existing IT landscape
Security and privacy in GA4 integrations
Visit behaviour, IP addresses and client IDs are personal data as soon as they can be linked to a person, which means GA4 measurement falls under the GDPR. In 2024 the Dutch Data Protection Authority (Autoriteit Persoonsgegevens) confirmed that GA4 can be used lawfully if it is configured in a privacy-friendly way. Appfront builds according to the Google Analytics security best practices and the OWASP ASVS: service account credentials in secure vaults, scoped OAuth permissions, GTM server-side containers for IP and PII filtering before data is sent to Google, and regular audits of the consent and tracking flows.
Google is ISO 27001, SOC 1/2/3 and GDPR compliant, and the EU-US Data Privacy Framework has settled much of the debate over data transfers to the US. We configure IP anonymisation, limited data retention, Google Signals switched off where not needed, and server-side tracking to filter personal data on your own infrastructure before it leaves. We document the data flows for your record of processing activities, so you can demonstrate compliance with the GDPR.
More on our security approach: information security policy and CVD policy.
- GDPR-compliant data processing and data minimisation
- Encryption in transit (TLS 1.2+) and at rest
- Role-based access and least-privilege principles
- Audit logs with traceable data flows
- Automatic retries and dead-letter queues
- Monitoring and alerting for anomalies
- Secrets management in line with best practice
- Documentation for your record of processing activities
Frequently asked questions about Google Analytics API integrations
Answers to the questions we are asked most often about GA4 implementations.
A Google Analytics API integration is a technical connection between Google Analytics 4 and your own systems. There are three APIs: the Data API v1beta for programmatically retrieving reports (runReport, runRealtimeReport, runPivotReport), the Admin API v1 for configuration management (properties, data streams, custom dimensions, audiences, Google Ads links) and the Measurement Protocol for server-side event tracking and offline conversions. A full integration also covers gtag.js or GTM, Consent Mode v2 for the EEA, native BigQuery export and reverse sync of conversions to Google Ads.
Yes, provided it is set up correctly. The Dutch Data Protection Authority confirmed in 2024 and 2025 that GA4 may be used as long as privacy-friendly settings are applied: IP anonymisation (default in GA4), switching off data sharing with other Google products where appropriate, short data retention, and preferably server-side tracking with minimal personal data. The EU-US Data Privacy Framework has settled much of the debate over data transfers to the US. Our starting point: GA4 is legally usable, but it must be actively configured securely. For those who want full data ownership, we recommend alternatives such as Matomo or Piwik PRO.
A basic setup (property, gtag.js on your site, core events and BigQuery export enabled) can go live within a week. Complete projects involving GTM server-side, Consent Mode v2 linked to your cookie banner, Enhanced Conversions for Google Ads, offline conversion imports via the Measurement Protocol, and a custom dashboard in Looker Studio or Power BI built on the Data API or BigQuery export take more time. After an intake meeting, we'll give you a realistic estimate.
We work with the official Google Analytics Data API v1beta, Admin API v1 and GA4 Measurement Protocol, combined with the backend stack that suits you: Node.js, Python, Java, .NET, PHP or Go (all with official client libraries). Authentication via OAuth 2.0 or service accounts. On the client side we implement gtag.js or Google Tag Manager; on the server side we set up a GTM Server Container (typically on Cloud Run or App Engine). For deeper analysis we use the native BigQuery export (free in GA4) and dashboards in Looker Studio, Power BI or Tableau.
Costs are determined by the complexity of the tracking setup (number of custom events and dimensions), whether server-side GTM is needed (including Cloud Run infrastructure), whether you want Consent Mode v2 and Enhanced Conversions implemented, the scope of the Data API dashboards and the BigQuery transformations. Ongoing management, monitoring and support also play a role. We always provide a clear quote following a no-obligation analysis of your situation.
Yes, provided it is set up properly. GA4 is ISO 27001 and SOC 2 compliant, and data can be processed in EU data centres under the Data Processing Terms. Important: enable IP anonymisation (default in GA4), limit data retention, switch off Google signals where not needed, and where possible use server-side tracking via GTM to filter personal data on the server side. Under the GDPR there must be a legal basis, often legitimate interest following a DPIA. Appfront builds according to OWASP ASVS and documents the full data flows for your record of processing activities.
Yes. Appfront regularly takes over existing GA4 implementations, even if they were originally set up by another party. We carry out a review of the event architecture, Consent Mode v2, GTM container (client and server-side), Enhanced Conversions, BigQuery export, data retention and GDPR compliance, document the current setup and propose improvements. From that point on, we can handle adjustments, extensions and monitoring, including timely API credential rotation and version updates.
GA4 suits organisations that rely heavily on Google Ads, Enhanced Conversions and the wider Google Marketing Platform (Looker Studio, Google Search Console, Tag Manager, BigQuery). Typically: e-commerce (Shopify, Magento, WooCommerce) using Google Shopping and Performance Max, B2B SaaS with Google Ads-driven lead generation, publishers and media using AdSense or Ad Manager, and apps using Firebase. For organisations that require absolute data sovereignty or HIPAA compliance (government, healthcare, banking), we recommend a GDPR-first platform such as Matomo or Piwik PRO. Appfront helps you make either choice objectively.
Ready to build your Google Analytics integration?
Tell us what you want to measure, what your Google Ads strategy is and which consent and GDPR requirements apply. We are happy to help you think through the tracking architecture, server-side GTM, Consent Mode v2, BigQuery dashboards and Enhanced Conversions. A no-obligation first conversation will give you a clear picture of the possibilities within half an hour.