Usercentrics - PUBLIC

How do I test the implementation of the Usercentrics CMP with DevTools?

This article describes how you can test your implementation of the Usercentrics CMP by using the Developer Tools of your browser.

This article describes how you can test your implementation of the Usercentrics CMP by using the Developer Tools of your browser.

Overview


This needs to be done up front

Implement the CMP (Version 1 or 2) directly in the <head> section of the website (recommended) or via the Google Tag Manager.


How to test the implementation of the CMP

In the following example, we use the Google Analytics script via a Google Tag Manager implementation. Make the appropriate adjustments for your script.

Before:

After:

Important: As there are 2 separate script-tags that are responsible for Google Analytics, both tags must be “blocked” through Usercentrics. So we add a type="text/plain" and also a data-usercentrics="Google Analytics" attribute to both.

  • Open the website in a browser (e.g. Google Chrome) without interacting with the CMP.

  • Open the developer tools (right click on any item > Examine).

  • Expand the <head> section by clicking on the arrow on its left.

In the <head> area, look for the script you customized

  • In the developer tools, switch to the network column

  • Examine the network calls. In our case we are looking for a call from the domain googletagmanager.com. Remember: this should not occur because you have not yet interacted with the CMP.

  • (If you do not see the "Domain" column, you can add it by right-clicking on the top line to open a menu where you can "Choose Domain").

After making sure that no network call went to googletagmanager.com, click on "Accept" in the banner

  • Under the Elements column, the indicator of the Google Analytics script should have changed from type="text/plain" to type="text/javascript".

  • Now, switch back to the network column. A network call should now have gone to a domain that contains googletagmanager.com.


Summary

The Developer Tools will help you to find out if you have configured your CMP correctly.



Do you need further help?

How can I get help with technical questions?

 

Usercentrics - PUBLIC