Skip to main content
All CollectionsCookie Banner
How to configure cookies placed via a HTML script tag?
How to configure cookies placed via a HTML script tag?
Alex Franch Tapia avatar
Written by Alex Franch Tapia
Updated over 2 months ago

⚠️ If you’re looking to add Google Analytics, Google Ads, Floodlight or Conversion Linker and receive traffic from the UK & EEA you need Google Consent mode. You can learn more about Google Consent Mode here and how to implement it here.

Configuring HTML scripts

We need to modify the script to have the following properties:

  1. The script type must equal text/plain. If your script line doesn't have a type, add it.

  2. It must have a data-usercentrics property equal to the name of the tool on your Personal Data Inventory and Cookie Banner.

  3. It must not have an async property.

Example of how we would modify our Trustpilot script on our website.

// Original Script
<script type="text/javascript" src="//widget...js" async></script>
  1. Change the type attribute to type=text/plain

    // Original Script
    <script type="text/javascript" src="//widget...js" async></script>

    // Step 1: change type attribute
    <script type="text/plain" src="//widget...js" async></script>

  2. Add an attribute called data-usercentrics="Trustpilot". Make sure that the name of the Tool and Third Party matches exactly the name that appears on your Tools and Third Parties.

    // Original Script
    <script type="text/javascript" src="//widget...js" async></script>

    // Step 1: change type attribute
    <script type="text/plain" src="//widget...js" async></script>

    // Step 2: add data-usercentrics="Trustpilot"
    <script type="text/plain" data-usercentrics="Trustpilot" src="//widget...js" async></script>

  3. Remove any async attributes. It may be the case that your script doesn’t have it.

    // Original Script
    <script type="text/javascript" src="//widget...js" async></script>

    // Step 1: change type attribute
    <script type="text/plain" src="//widget...js" async></script>

    // Step 2: add data-usercentrics="Trustpilot"
    <script type="text/plain" data-usercentrics="Trustpilot" src="//widget...js" async></script>


    // Step 3: remove any async attributes
    <script type="text/plain" data-usercentrics="Trustpilot" src="//widget...js"></script>
Did this answer your question?