Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Loader.js is the newest version of our CMPv2 Script, with improved performance, by adding code splitting and automatically deciding what version of bundle.js should you use, based on your browser version.

What should you do to update to Loader.js

Since the loader.js is an all-new script, it also brings some new changes to our API and to our current Script implementation. So you will need to follow these steps to update to the newest loader.js

...

:

  1. Update your current Usercentrics CMP ScriptsThe loader.js is a new script, so you will need to change your bundle.js or bundle_legacy.js scripts

...

  1. . Do not worry about legacy browsers. loader.js will automatically decide if it should use bundle.js or bundle_legacy.js based in your browser and in your browser version. These are the new scripts that you should change to:

    • For Normal Users

      Code Block
      languagehtml
      <script id="usercentrics-cmp" 

...

    • src="https://app.usercentrics.eu/browser-ui/latest/loader.js" data-

...

    • settings-id="XXXXXXX" async></script>

...

    • For TCF2.0 Users

      Code Block
      languagehtml
      <script id="usercentrics-cmp" data-settings-id="XXXXXXX" src="https://app.usercentrics.eu/browser-ui/latest/loader.js" data-

...

    • tcf-enabled></script>
  1. Adapt your current code → As you've seen in your consoles inside your pages, there are some functions from our API that are deprecated, so you will need to adapt them to the new versions:

Why should you update to this new script

...

Having this change to the code increases the performance of our CMP and therefore increases the lighthouse performance of your page.

Code that also needs to be adapted

As you've seen in your consoles inside your pages, there are some functions from our API that are deprecated, so you will need to adapt them to the new versions:

...

getServices should be changed by getServicesBaseInfo or getServicesFullInfo, and

...

.

About the current scripts

...