Articles on: How to Preserve Analytics While Using IP Anonymization in Google Analytics

Preserving Conversion Rate with Google Consent Mode


Google Consent Mode



Google Consent Mode is an API developed by Google to help improve the accuracy of marketing analysis and planning by using conversion modeling based on users who have "accepted" cookies. It uses machine learning to predict the likelihood of conversions from users who did not accept cookies. This helps us analyze user behavior and conversion probability more accurately, resulting in up to a 70% increase in conversion rate compared to setups that don’t use Google Consent Mode ( Conversion modeling through Consent Mode in Google Ads).

In addition, Google Consent Mode respects data privacy and complies with PDPA and GDPR, as it does not collect cookie data from users who did not provide consent. Instead, it uses data from consenting users to model the possible conversions.

Note: If your website collects personally identifiable information for analysis or marketing, you are legally required under PDPA to obtain consent from users first. However, if your goal is to monitor the number of users and the traffic sources to your website — including users who did not provide consent — Google Consent Mode allows you to analyze conversion data with much greater accuracy.


Normally, Google-provided tag scripts will read/write cookies and send HTTP requests to support features such as analytics, conversion tracking, and remarketing.

Google provides Consent Mode to allow web developers to control cookie access in Google tag scripts and update the configuration once the user gives consent.


Google Ads
Floodlight
Google Analytics
Conversion Linker




To link a Google script tag with the user’s consent status, you can use the following API format:

gtag('consent', '<consent_command>', {
  <consent_type_settings>
});


Where:

<consent_command> can be:
'default': Sets the initial default for the page
'update': Updates the tag settings, typically used when the user provides consent via Cookie Wow

<consent_type_settings> is an object specifying whether access to each tag is 'denied' or 'granted'.




This configuration prevents Google Analytics and Google Ads from writing first-party cookies on your website.



You can still track site traffic using aggregated data. See more details here: Consent Mode




After setting the default to “denied,” the next step is to update the gtag consent based on the category the user selected. You’ll need to have the Cookie Wow script installed first (see: how to install the Cookie Wow script).

If it's already installed, you can update the gtag consent by declaring a JavaScript function called `cwcCookieWrapper` as shown here:



This function will be automatically called by the Cookie Wow script under the following conditions:
When the user clicks “Accept” on the cookie banner
When the user edits their preferences and confirms them
When the user has previously given consent and revisits or navigates through the site again


You can also adapt this function for other purposes by using:

window.cwcIsUserAccept('CategoryName')


This can be used to check whether the user accepted a specific consent category as defined in the Cookie Wow "Manage Cookies" settings.

As shown above, you can then call Google’s API to update consent according to the category consented to by the user.

Updated on: 28/05/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!