Stay organized with collections
Save and categorize content based on your preferences.
This page is for developers who maintain their own consent solution on their
website and want to integrate consent mode. For an introduction to consent mode,
read Consent mode overview. If you use a Consent Management Platform (CMP)
to obtain user consent, learn more about how to set up consent mode with a CMP.
You can implement consent mode in a basic or advanced way. Check your company's
guidelines to pick an implementation method and which defaults to set. Learn
more about basic versus advanced consent mode.
Before you begin
Take the following into consideration before implementing consent mode:
If you use Tag Manager and want to maintain your own banner, the recommended
approach is loading your banner through the Tag Manager container. To do so,
you need to create a consent mode template. Alternatively, you can use a
consent mode template from the Community Template Gallery.
If you use gtag.js, make sure you have installed the Google tag on every
page of your website. The consent mode code gets added to each page of your
website.
As a part of Google's ongoing commitment to a privacy-centric digital
advertising ecosystem, we are strengthening the enforcement of our EU user
consent policy.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-19 UTC."],[[["\u003cp\u003eThis guide explains how to integrate Google's consent mode for developers managing their own website consent solution.\u003c/p\u003e\n"],["\u003cp\u003eConsent mode allows you to control data collection based on user consent for advertising and analytics purposes.\u003c/p\u003e\n"],["\u003cp\u003eYou need to set the default consent state and update it based on user interactions with your consent settings.\u003c/p\u003e\n"],["\u003cp\u003eConsent mode was recently updated and now includes additional parameters for advertising user data and personalization.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers using legacy tags are encouraged to update to gtag.js or Google Tag Manager for better privacy controls.\u003c/p\u003e\n"]]],["Developers implementing their own consent solution should set up consent mode by first defining the default consent state before user interaction. They should then update the consent state based on user choices, ensuring updates are tracked before any page transitions. Consent mode has been updated to include `ad_user_data` and `ad_personalization` parameters. Users with older consent mode versions need to upgrade to v2. Legacy tags should be updated to gtag.js or Google Tag Manager.\n"],null,[]]