Piano Analytics (AT Internet)

Piano Analytics (AT Internet) is an analytics solution authorized by the French Data Protection Authority (CNIL) to provide analytics services without user consent. Piano Analytics supports three modes:

  • Essential (CNIL exemption)

  • Opt-in (Full analytics tracking)

  • Opt-out (Complete deactivation)

Didomi will support the essential and the opt-in mode while the opt-out mode will have to be added on one of your websites pages.

Other Data Protection Authorities in Europe may not allow analytics with Piano Analytics if consent is not given by the user.

This guide will help you activate the Piano Analytics hybrid measure to use the CNIL essential mode.

The Piano Analytics prerequisites for the use of this feature are:

Configure Didomi

If you are using the Piano Analytics essential mode, you will have to add some information to the text displayed in the preference view and add the Piano Analytics vendor in your notice.

Change the Preferences - Purposes text

When using the Piano Analytics hybrid measure feature, you will also have to add a link redirecting to one of your website pages. This page will have to allow your users to completely disable Piano Analytics (opt-out mode).

In the console browse to the Consent Notices section and select the notice related to the use of Piano Analytics.

Select the Content editor section of your notice in Customization and go to the Purposes specific subsection to change the content of the text displayed at the top of the Preferences view.

Add the following mention to the existing text in French:

Nous utilisons également des traceurs exemptés du recueil de consentement pour le dépôt des cookies de mesure d'audience. Vous pouvez utiliser une fonction d'opt-out via notre <a href="<https://www.example.com/opt-out-link">politique de confidentialité</a>.

You can change it to fit your needs if you want to. Also, don't forget to change the link https://www.example.com/opt-out-link to the one you want to use. If the link is the same as the one you are using for your Privacy Policy, you can use the {privacyPolicyURL} macro.

Then, select the Vendors & Purposes section in Regulations to add the Piano (Hybrid Analytics) vendor with the ID pianohybr-R3VKC2r4.

Click on the Save & Publish button on the top left of the page.

Enable the correct Piano Analytics mode on your website

1. Opt-in or essential mode

Once everything is configured in the Didomi console, you have to add the following code to your website along with the Didomi embed code:

window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function (Didomi) {
  // Check the consent status for the Piano Analytics vendor
  const userStatus = Didomi.getCurrentUserStatus();
  const defaultStatus =
    userStatus.vendors.hasOwnProperty("pianohybr-R3VKC2r4") &&

  if (defaultStatus) {
    // If the consent status is true, activate the opt-in visitor mode
  } else {
    // Else, if the visitor mode is not "opt-out", then activate the essential mode
    if (pa.consent.getMode() == null || pa.consent.getMode() !== "opt-out") {

2. Opt-out mode

Piano Analytics also suggests that you add a way for the user to completely deactivate the audience measurement.

Using Didomi and Piano Analytics, you will have to adapt your code to disable the vendor and the purpose along with the audience measurement feature. To do so, you will have to use openCurrentUserStatusTransaction().

Below is an example using a button with an ID #optout-piano.

window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function (Didomi) {
  const button = document.getElementById("optout-piano");
  // Add event handler
  button.addEventListener("click", function () {
    // Open Didomi Transaction
    const transaction = Didomi.openCurrentUserStatusTransaction();
    // Disable a purpose
    // Disable a vendor
    // Save user choices


pa.consent.setMode is the method exposed by Piano Analytics to set their consent mode. Their documentation is available here.

Deploy the opt-out button

If you want to use the button mentioned above, you will be able to deploy this by using the following text and code.

« Les cookies Piano Analytics (AT Internet) sont exemptés de la nécessité d'obtenir le consentement, comme indiqué dans l’Arrêt CNIL n°2020-091, dans la mesure où ils sont strictement nécessaires au bon fonctionnement du site. Vous pouvez refuser le traitement de vos données personnelles de navigation en activant cette option. Veuillez noter qu’en cliquant sur le bouton suivant, nous ne pourrons plus mesurer et améliorer nos sites de manière optimale. »

<button id="optout-piano">Opt Out</button>

The link between Didomi and Piano Analytics is now done.

Last updated