UniConsent
Updated: Use Google Consent Mode and UniConsent API on 1st April 2021.
People are looking for how to make your Google Analytics compliant with GDPR. There are only three steps to make your sites with Google Analytics compliant with GDPR.
Google Analytics has integrated with TCF version 2 recently, so you can implement it with TCF V2 CMP to make it respecting user's GDPR consent and choices.

Install a certified EU IAB TCF CMP such as UniConsent CMP. UniConsent has started to support TCF version 2 since 2019. It is fast loading and not blocking your pages.
Switching to UniConsent CMP or contact us for support if any questions: hello@uniconsent.comSwitch your old Google Analytics tags including https://www.google-analytics.com/analytics.js to the new tags
You can get this by visiting https://analytics.google.com/analytics/web/, then click "Admin" and "Tracking Info", "Tracking Code".
You can use either Global Site Tag (gtag.js) or by installing with Google Tag Manager.
Add the following code before your Google Analytics tags or your Google Tag Manager:
<script>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
})
__tcfapi('addEventListener', 2, function (tcData, success) {
if (success && tcData.unicLoad === true) {
gtag('consent', 'update', {
ad_storage: 'granted',
analytics_storage: 'granted',
})
}
})
</script>
Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.
Activate Google Consent Mode UniConsent to enhance the accuracy of your Google Analytics and Google Ads conversion data.
Set up Google Consent Mode →Get started to make your website and application compliant for EU GDPR, US CPRA, CA PIPEDA etc
Sign up
IAB TCF 2.3: Key Updates for Publishers and Advertisers

GPP National v2 for Publishers: Simplifying U.S. Privacy Compliance with Google Ads
Maximize Google Ads ROI with Consent Mode Support from UniConsent

Why Consent Management Matters for Mobile Apps in 2025

Google Consent Mode v2 Enforcement Is Here and How to Stay Compliant and Preserve Your Conversions

UniConsent Now Supports the WP Consent API for Enhanced Privacy Compliance
Get started to make your website and application compliant for EU GDPR, US CPRA, CA PIPEDA etc
Sign up