Custom Google Analytics API integration
Appfront builds custom Google Analytics 4 integrations that make the most of GA4 and are set up to be GDPR-compliant. From the Data API and Admin API to the Measurement Protocol for server-side tracking, Google Tag Manager client-side and server-side containers, Consent Mode v2 for the EEA, Enhanced Conversions for Google Ads and the native BigQuery export. The result: reliable attribution, complete data ownership via BigQuery and a set-up the Dutch Data Protection Authority would approve.
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 one available following the end of Universal Analytics. GA4 is entirely event-based, stores data in a columnar format and, new compared with 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: with the Admin API v1 you manage properties, data streams, custom dimensions, audiences and Google Ads links programmatically. Activation: with the Measurement Protocol you send server-side events, offline conversions and CRM data to GA4, and with 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 complies with the GDPR guidelines of the Dutch Data Protection Authority.
Free BigQuery export in GA4
Where Universal Analytics only offered this in the 360 tier, GA4 lets you send all event data to BigQuery as standard, either daily or streaming. No sampling, no row limits: complete raw data with all user properties, events and item data for your own SQL analysis, Looker Studio dashboards or integration with your data warehouse.
GTM server-side for first-party tracking
With your own GTM server container on Cloud Run, App Engine or your own backend, events go to your infrastructure (your domain) first, 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 reaches the platform 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 work correctly. Together with Enhanced Conversions (hashed email/phone number), you retain attribution quality despite consent restrictions and the GDPR.
Our development process for GA4 API integrations
We work with a proven methodology that removes uncertainty early and delivers a stable GA4 setup that reassures both marketing and legal. From an initial analysis of your KPIs, Google Ads strategy and consent requirements through to go-live and ongoing maintenance, every step is aimed at a configuration your team can read and adjust itself.
We map out which KPIs, events and conversions take priority, what role Google Ads plays, which consent flow your legal team requires and whether server-side tracking or BigQuery export is needed. The 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.
A controlled go-live with data validation and a safety net, followed by ongoing maintenance 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 features we deliver most often for organisations that use GA4 as their analytics backbone alongside Google Ads, BigQuery and Looker Studio.
gtag.js & GTM client-side
A correct implementation of gtag.js or Google Tag Manager on your site, with an event schema that suits GA4 (not a UA 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 your own GTM Server Container on Google Cloud Run, App Engine or a custom Node backend on your own domain. Events go to your server first (first-party), are enriched there (user ID lookup, IP masking, consent enforcement) and only then forwarded to GA4, Google Ads, Meta and others. Lower drop-off from ad blockers and better control over privacy.
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 instead of the GA4 UI. In Python, Node.js or Java via the official client libraries.
Consent Mode v2 + Enhanced Conversions
Linking 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
Through the Admin API v1, we manage properties, data streams, custom dimensions, audiences and Google Ads/BigQuery/Firebase links programmatically. With governance-as-code (Terraform or custom scripts), you keep your configuration reproducible and audit-ready, and you can set up new tracking environments in minutes instead of clicking through settings for hours.
Typical use cases in practice
A GA4 API integration works out very differently for each type of organisation. We see a number of patterns come up again and again, and for each of them we have a working setup that covers tracking architecture, consent flow, Google Ads link and BigQuery dashboards.
E-commerce with Google Ads
Online shops 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 honest ROAS measurement despite ad blockers and consent drop-off. See also our API integrations.
B2B SaaS & lead generation
SaaS companies and B2B service providers that generate leads via 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 retargeting audiences 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 per template, Google Signals for cross-device attribution, and custom dashboards in Looker Studio for editorial and commercial teams.
Apps via Firebase
iOS and Android apps that use Firebase, where Firebase Analytics flows automatically into a linked GA4 property. Cross-platform attribution (web + iOS + Android), deep-link tracking, user ID consistency 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 exact choice depends on whether you want server-side tracking, make use of BigQuery and which Google Ads features are relevant, so that your own team can manage or further develop the implementation.
If you also want search data from Google in your systems alongside Analytics, read about the Google Search Console integration.
Why 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, because an integration must not only be technically sound but also add practical value to the way you work.
For every integration we write clear documentation and make sure your own team, or a future supplier, can understand and manage the integration. No black box, but 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. That keeps communication lines short, prevents miscommunication and speeds up decisions when choices have to be made during the build.
Looking for a GDPR-first alternative? See our Matomo and Piwik PRO pages. Learn 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 Dutch Data Protection Authority (AP) compliance
- Secure by default — API key rotation, webhook signature validation, scoped permissions
- Structured error handling and retry mechanisms
- Extensive logging and monitoring from day one
- Clear documentation that your team can read and maintain
- A single point of contact, no passing you between account managers
- Ongoing maintenance and proactive further development
- An approach tailored to your existing IT landscape
Security and privacy in GA4 integrations
Browsing behaviour, IP addresses and client IDs count as personal data as soon as they can be linked to an individual, which means GA4 measurement falls under the GDPR. In 2024, the Dutch Data Protection Authority (Autoriteit Persoonsgegevens) confirmed that GA4 can be used lawfully, provided it is set up in a privacy-friendly way. Appfront builds in line with 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 reaches 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 the debate on data transfers to the US. We configure IP anonymisation and limited data retention, disable Google Signals where it isn't needed, and use server-side tracking to filter personal data on your own infrastructure. We document the data flows for your record of processing activities, so you can demonstrate compliance with the GDPR.
More about our approach to security: information security policy and CVD policy.
- GDPR-compliant data processing and minimisation
- Encryption in transit (TLS 1.2+) and at rest
- Role-based access and least-privilege principles
- Audit logs with traceable data flows
- Automatic retry and dead-letter queues
- Monitoring and alerting for anomalies
- Secrets management following best practices
- Documentation for your record of processing activities
Frequently asked questions about Google Analytics API integrations
Answers to the questions we get asked most often about GA4 implementations.
A Google Analytics API integration is a technical link between Google Analytics 4 and your own systems. There are three APIs: the Data API v1beta for retrieving reports programmatically (runReport, runRealtimeReport, runPivotReport), the Admin API v1 for configuration management (properties, data streams, custom dimensions, audiences, Google Ads integrations) and the Measurement Protocol for server-side event tracking and offline conversions. A complete integration also includes 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. In 2024 and 2025, the Dutch Data Protection Authority confirmed that GA4 may be used as long as privacy-friendly settings are applied: IP anonymisation (default in GA4), disabling 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 the debate on data transfers to the US. Our starting point: GA4 is legally usable, but it has to be configured actively and securely. If you want absolute 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 be live within a week. Full projects take longer: GTM server-side, Consent Mode v2 linked to your cookie banner, Enhanced Conversions for Google Ads, offline conversion imports via Measurement Protocol, and a custom dashboard in Looker Studio or Power BI built on the Data API or BigQuery export. After an intake meeting, we 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 official client libraries). Authentication is 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 (usually 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.
The cost depends on the complexity of the tracking setup (number of custom events and dimensions), whether GTM server-side is needed (including Cloud Run infrastructure), whether you want to implement Consent Mode v2 and Enhanced Conversions, the scope of the Data API dashboards and the BigQuery transformations. Ongoing management, monitoring and support also play a part. We always provide a clear quote after a no-obligation analysis of your situation.
Yes, provided it is set up properly. GA4 is ISO 27001 and SOC 2 compliant, and under the Data Processing Terms data can be processed in EU data centres. What matters: keep IP anonymisation switched on (the default in GA4), limit data retention, turn off Google signals where they are not needed, and use server-side tracking via GTM where possible to filter personal data on the server side. Under the GDPR you need a legal basis — often legitimate interest following a DPIA. Appfront builds to OWASP ASVS and documents the full data flows for your record of processing activities.
Yes. Appfront regularly takes over the management of existing GA4 implementations, even when they were originally set up by another party. We review 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 draw up improvement proposals. From that point on we can handle changes, 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). Typical examples: e-commerce (Shopify, Magento, WooCommerce) with Google Shopping and Performance Max, B2B SaaS with Google Ads-driven lead generation, publishers and media with AdSense or AdManager, and apps with Firebase. For organisations that have strict data sovereignty or HIPAA requirements (government, healthcare, banking), we recommend a GDPR-first platform such as Matomo or Piwik PRO. Appfront gives objective advice on both options.
Ready to build your Google Analytics integration?
Tell us what you want to measure, which Google Ads strategy you are running and which consent and GDPR requirements apply — we are happy to help you think through tracking architecture, GTM server-side, 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.