Migration of the CMP implementation

Since version 32.0.0 of the CMP, the implementation in your website has been simplified. In the page, we will see how to migrate step by step from old implementation to the new one.


New implementation

The code to be implemented in your website is provided under each notice in the configuration interface and can be easily copied using the "Copy" button. All that remains is to paste the code into the <head> section of your website.

Event listener

The event listener has been integrated directly into the notice, so it is no longer necessary to add it on all the pages of your website. You can therefore remove the following script from your website.

triangle-exclamation

The init and show commands

From now on, the init and show commands are automatically executed at the initialization of the notice and this implies changes in the implementation of the notice.

The init command

Previously, it was necessary to implement the following script in the <body> section of HTML pages.

triangle-exclamation

Callback of the init command

If you have defined a callback in the init command, you must now add it to the configSFBXAppConsent configuration variable in the callbacks parameter.

As a reminder, the callback will be executed at the end of the initialization of the notice. And takes as input parameters error and state.

circle-info

INFO

In the documentation for the old implementation, we suggested putting console.log as a callback to the command. If you are in this case, it is no longer necessary to set it as callback.

Example of init callback configuration :

The show command

Same as the init command, the show command no longer needs to be implemented like this :

triangle-exclamation

Callback of show command

If you defined a callback in the show command, you must now add it to the configSFBXAppConsent configuration variable in callbacks parameter.

As a reminder, this callback will be executed at the end of the command execution. And takes as input parameter error.

circle-info

INFO

In the example code of the old implementation, we proposed in the documentation to put console.log in the callback of the command If you are in this case, it is no longer necessary to put it in callback.

Example of callback configuration :

Change in the configuration of the CMP

Option url

The url option has now the following default value : https://collector.appconsent.io. It is not necessary to have this option in your cmp configuration, if you use this url.

triangle-exclamation
circle-info

NEW IMPLEMENTATION

Option lazy

The lazy option is now enabled by default, if you had enabled the lazy option, it is no longer required to have it in the configuration.

triangle-exclamation
circle-info

NEW IMPLEMENTATION

Guardian

If you haven't implemented guardian, you can skip this chapter.

The guardian configuration has been changed. Previously, it was necessary to add a <script> tag in which you defined the urls you wanted to blacklist or whitelist.

triangle-exclamation

Now this configuration must be put in the configuration variable configSFBXAppConsent with the parameter dynamicallyLoadedScripts with two subparts blacklist and whitelist.

circle-check

The Guardian script has been changed to accommodate this new way of configuring Guardian. So you have to replace the old <script> tag containing the Guardian code with this one:

Please go tho this page to get last instructions to use Google Consent Mode v2 with our CMP.

How to implement GCM

Implementing our CMP using Google Tag Manager

One of the solution proposed was to use your tag manager to trigger Google Analytics tags based on the purpose_events sent to the dataLayer. Depending on what you have implemented in your pages, you can remove it to migrate to the new implementation.

For more information, see page : Install AppConsent with Google Tag Manager

Last updated