Google Consent Mode allows web and app developers to adjust tag and app SDK behavior based on user consent choices. Onesecondbefore fully integrates Google Consent Mode v2 in their CMP offering.
type | description |
---|---|
ad_storage | Enables storage, such as cookies (web) or device identifiers (apps), related to advertising. |
ad_user_data | Sets consent for sending user data to Google for online advertising purposes. |
ad_personalization | Sets consent for personalized advertising. |
analytics_storage | Enables storage, such as cookies (web) or device identifiers (apps), related to analytics, for example, visit duration. |
functionality_storage | Enables storage that supports the functionality of the website or app, for example, language settings |
personalization_storage | Enables storage related to personalization, for example, video recommendations |
security_storage | Enables storage related to security such as authentication functionality, fraud prevention, and other user protection |
In case you use our IAB TCF Consent Wall, we provide an automatic mapping from IAB TCF to Google Consent Mode as recommended by Google.
The Google Consent Mode items will be set to granted
if the purposes or special features are switched on.
item | purposes | special features |
---|---|---|
ad_storage | 1 | any |
ad_user_data | 1, 7 | any |
ad_personalization | 3, 4 | any |
analytics_storage | any | any |
functionality_storage | any | any |
personalization_storage | any | any |
security_storage | any | any |
Google Signals will be disabled in Google Analytics if either purpose 7, 9 or 10 are switched off.
In case you use the consent banner of our CMP or a third party CMP, you can use the code examples below to enable Google Consent Mode on your website.
You enable Google Consent Mode in Onesecondbefore with adding the googleConsentMode
config parameter to the page tag. The parameter should contain
a call to an existing function or an anonymous function that return a JSON object with the Google Consent Mode types set to either 'denied'
or 'granted'
.
The following example contains a configuration with an existing function.
osb('config', {
accountId: 'act123',
cookieDomain: 'mydomain.com',
cookieNamePrefix: '_osb_',
cookiePath: '/',
cookieSettings: 1,
siteId: 'mygreatsite',
forceGET: false,
ipSettings: 0,
userCookieTimeout: 31536000,
googleConsentMode: (purposes) => {
return {
ad_storage: purposes.includes('all') || purposes.includes('advertising') ? 'granted' : 'denied',
...
}
}
});
And the example below contains the configuration with an existing function.
function getGoogleConsentMode(purposes) {
return {
ad_storage: purposes.includes('all') || purposes.includes('advertising') ? 'granted' : 'denied',
...
}
}
osb('config', {
accountId: 'act123',
cookieDomain: 'mydomain.com',
cookieNamePrefix: '_osb_',
cookiePath: '/',
cookieSettings: 1,
siteId: 'mygreatsite',
forceGET: false,
ipSettings: 0,
userCookieTimeout: 31536000,
googleConsentMode: getGoogleConsentMode
});
Below is a list of default purposes that can be expected when using our Consent Bar. Source
purpose | description |
---|---|
necessary | Strictly necessary cookies — These cookies are essential for you to browse the website and use its features, such as accessing secure areas of the site. Cookies that allow web shops to hold your items in your cart while you are shopping online are an example of strictly necessary cookies. These cookies will generally be first-party session cookies. While it is not required to obtain consent for these cookies, what they do and why they are necessary should be explained to the user. |
analytics | These cookies collect information about how you use a website, like which pages you visited and which links you clicked on. Data can be matched and combined with other data sources. Different devices can be linked. |
personalization | Personalization cookies - Creation and use of profiles to deliver a personalized experience on your website. |
advertisement | These cookies track your online activity to help advertisers deliver more relevant advertising or to limit how many times you see an ad on a publisher website. These cookies can share that information with other organizations or advertisers. These are persistent cookies and almost always of third-party provenance. |
social | These cookies track your online activity to help social networks to deliver more relevant content on a social platform. These cookies can share that information with other organizations or advertisers. These are persistent cookies and almost always of third-party provenance. |
In case you would like to rewrite the default behaviour of the Consent Wall, all purpose and feature names are sent as a string array argument. The table below contains the purpose or feature and the readable name we chose to identify a particular purpose.
purpose or feature | number | name |
---|---|---|
purpose | 1 | storage |
purpose | 2 | advertising |
purpose | 3 | ads_profile |
purpose | 4 | personalised_ads |
purpose | 5 | content_profile |
purpose | 6 | content |
purpose | 7 | ad_performance |
purpose | 8 | content_performance |
purpose | 9 | market_research |
purpose | 10 | product_improvement |
purpose | 11 | content_limited_data |
special feature | 1 | precise_geo |
special feature | 2 | device_scan |