Google Consent Mode

Debug mode in CookieOfficer

How to check Google Consent Mode on your website. The ?co_debug=1 parameter shows the mode, the consent order and every consent update in the console.

6 min read

Debug mode lets you check whether Google Consent Mode works correctly on your website. The browser console shows information, for example about the selected Google Consent Mode mode, the order in which the default state was set, and every change to the user's decision. To turn on debug mode in CookieOfficer, add the co_debug parameter to the page URL. The messages in the browser console are visible only to people who run the test. Regular visitors to the website do not see them.

When should you use debug mode?

  • After you first set up Google Consent Mode.
  • If you notice Google Consent Mode issues in messages in Google Tag Assistant, Google Ads or Google Analytics.
  • After you change the website template or the Google Tag Manager container.
  • After you turn on Google tag gateway.

How to start debug mode in CookieOfficer

  1. Go to a page where CookieOfficer is installed.
  2. Add this parameter to the end of the URL: ?co_debug=1. Example: https://www.example.com/?co_debug=1
  3. Refresh the page to load it again.
  4. Open the browser developer tools with F12.
  5. Open the "Console" tab.
  6. In the filter field, enter the CookieOfficer message prefix: [CookieOfficer debug]

If your page URL already contains a ? character, add the parameter after an & character:

https://www.example.com/shop?category=shoes&co_debug=1

You can also turn on debug mode by adding the parameter co_debug=true or co_debug. The language of the messages depends on the browser language of the person who runs the check. The messages appear in Polish or in English.

Debug mode is not saved. It works only on a page with the right parameter in the URL, so you have to add it again on every new page. To turn off debug mode, remove the parameter from the URL and refresh the page. The parameter co_debug=0 does not start debug mode.

What information appears in the browser console?

InformationMeaning
CookieOfficer Developer IDThe CookieOfficer ID at Google: dZmQwMD. The CookieOfficer code sets it automatically.
Google Consent Mode settingInformation about the Google Consent Mode setting in the panel: on or off, and about the selected mode: "Basic" or "Advanced".
Order of setting the default stateInformation on whether the default consent state was set before Google tools started. The verdict comes from Google tools.
Consent updatesEvery change to the consent state after the user makes a decision, with the list of consent types and their values. Shown only when Google Consent Mode is on, also on a later visit with a saved decision.

The first two lines in the console look like this:

[CookieOfficer debug] Debug mode is on (project co-…). Google developer ID: dZmQwMD.
[CookieOfficer debug] Google Consent Mode in the dashboard: on, Basic mode.

Warnings appear in yellow when the default state is set too late or is missing. Other messages are for information.

What do the messages mean?

The default consent state was set before Google tools started

The Google Consent Mode default state was set before Google tags. The order is correct.

What it means: the order is correct. Google tools received the consent information before they started.

Recommended action: you do not need to do anything else. Check the three scenarios described below.

The default consent state was set too late

The Google Consent Mode default state was set too late: a Google tag read consent before it. Common causes: Google tag gateway or a Google tag placed above the default consent block. How to fix it: https://cookieofficer.com/help/troubleshooting/google-tag-gateway

What it means: Google tools checked the consent state before the default state was set. This usually happens because of Google tag gateway or because the Google tools code is placed in the page code before the default consent block. The message includes a link to an article that describes the solution.

Recommended action: follow the article Google tag gateway: Google tags running before the Google Consent Mode default state.

No Google tools on the page

No Google tag was found on this page, so the order cannot be checked.

What it means: no Google tools were found on the page, so the order cannot be checked.

Recommended action:

  • In "Basic" mode, this message appears before the user makes a decision, because Google tools wait for consent. Click "Accept", then refresh the page with the parameter. The order verdict appears once, about one second after the page loads, and does not appear again after you click "Accept".
  • Turn off the ad blocker in your browser and refresh the page.
  • Check whether this page has Google tools installed.

Google tools run without a default consent state

The Google tag runs without a Google Consent Mode default state. Set the default state before Google tags: with the block from the dashboard (Installation), in the Google Tag Manager template or in the WordPress plugin.

What it means: Google tools started without a default consent state.

Recommended action: set the default consent state before Google tools. Use the block from the panel in the "Installation" tab, Google Consent Mode in the Google Tag Manager template, or the WordPress plugin.

Consent update

Google Consent Mode update: analytics_storage=granted, ad_storage=…, ad_user_data=…, ad_personalization=…, functionality_storage=…, personalization_storage=…, security_storage=granted

What it means: the system updated the consent state after the user's decision. The message appears in the same form in both languages and is also shown on a later visit if the decision was saved.

Google Consent Mode turned off in the panel

Google Consent Mode in the dashboard: off.

What it means: the Google Consent Mode integration is turned off in the panel. This line is for information only. If you turn on Google Consent Mode in the Google Tag Manager template and it stays off in the panel, the console shows this message even if the template passes on consent.

Recommended action: if the Google Tag Manager template does not pass on consent, turn on the integration as described in the article "Google Consent Mode v2: Basic and Advanced mode".

How to test the scenarios

Run the test in an incognito window. In a normal window, the browser remembers the user's earlier choice and the banner does not appear.

  1. Open the page with the ?co_debug=1 parameter in incognito mode.
  2. Before you make a decision in the banner, check the order in the message.
  3. Click "Accept".
  4. Check the update. Consent types in the accepted categories should have the value granted.
  5. Close the incognito window and open a new one.
  6. Open the website again with the parameter and click "Reject" (in some templates "Reject all").
  7. Check whether consents for categories other than necessary have the value denied.

Other ways to check your setup

  • The check is in the "Settings" tab, in the "Integration with analytics and advertising tools" block, under the "Verify setup" button. The check uses the same verdict as debug mode.
  • Tag Assistant: Google recommends selecting the first event of the "Consent" type in the "Summary". The "Consent" tab shows the "On-page Default" and "On-page Update" columns.
  • Google Tag Manager preview shows the order of events. The CookieOfficer template should fire on the consent initialization event.

Most common mistakes when using debug mode

  • Adding the parameter without reloading the page.
  • Running the test in a window where the user's decision is already saved. In that case the banner does not appear, and you cannot check the state before the decision.
  • The parameter must be entered before the # character. It cannot come after it.
  • An active ad blocker hides Google tools. The console shows a message that they are missing.
  • Looking for the messages in the CookieOfficer panel. The messages appear only in the browser console.
  • The system shows the verdict only once, when the page loads. After you click "Accept", you have to refresh the page to see the order verdict again.
  • A page checked at an address outside the project domain does not start the banner and does not show messages.

Frequently asked questions

Do website visitors see the messages in the browser console?

No. If you do not add the parameter, debug mode stays off. Only the person who added the parameter to the URL sees the messages.

Does debug mode affect how the website works?

No. Debug mode shows messages only in the browser console of the person who started it. The Drupal and TYPO3 plugins are an exception. After you add the parameter, they also show the banner to a logged-in administrator.

Can I use debug mode when CookieOfficer is set up with Google Tag Manager?

Yes. The Google Tag Manager template loads the same banner script.

Google documentation

Related articles

Didn't find an answer?

Write to us. We reply on working days, usually the same day.

Contact us