LogoLogo
Analytics HelperSirdata APISemantic APIA propos de Sirdata
English
English
  • Sirdata CMP
  • INSTALL
    • Web & Mobile web
    • AMP
    • Via a Tag Manager
      • Loading via Google Tag Manager
    • In a CMS
      • Loading in Shopify
      • Loading in Wordpress
      • Loading in Prestashop
      • Loading in Magento
      • Loading in Drupal
    • Cache Systems Exclusion
      • Autoptimize WordPress Plugin
      • Cloudflare WordPress Plugin
      • LiteSpeed WordPress Plugin
      • NitroPack WordPress Plugin
      • SG Optimizer WordPress Plugin
      • WP Super Cache WordPress Plugin
      • W3 Total Cache WordPress Plugin
      • WP Meteor Plugin for Wordpress
      • WP Rocket WordPress Plugin
  • CONSENT TRANSMISSION STANDARDS
    • Introduction
    • Google Consent Mode
      • Mandatory Prerequisite
      • Activation of Advanced Google Consent Mode
        • Via the Sirdata CMP
        • Via Google Tag Manager
      • Activation of Basic Google Consent Mode
        • Via the Sirdata CMP
        • Via Google Tag Manager
      • Activation via Sirdata CMP
      • Activation via Google Tag Manager
    • Microsoft UET Consent Mode
    • Microsoft Clarity Consent
  • CMP API
    • How it works
    • Examples
    • Working with iframes
  • Advanced features
    • Passive mode
    • Set language per user
    • Manually display the CMP
  • Script management
    • Remote Tags Management without a Tag Manager
    • Remote Tags Management with a Tag Manager
    • Tag Management with Google Tag Manager
    • Local script Management
    • Advanced configuration
    • Examples
    • Share the TC String
    • Tag Management setup service
  • Analytics
    • Google Analytics
  • F.A.Q.
    • Integration
      • Is Abconsent compatible with Stape?
      • Is ABConsent compatible with Addingwell?
    • Google Consent Mode V2
      • Google Consent Mode V2 utility
      • News Google Consent Mode V2
      • Advanced mode or basic mode
    • Packaging
      • Cookies management
      • Tags packaging
    • Cookie settings
    • Button operation
    • Button color
    • A/B test
    • Mobile, tablets ...
    • Multi-sites
    • Mobile display
    • Private browsing
    • AMP consent
    • AMP consent button
    • Tags conditionning
    • Google Ads
    • Error 6.1 Google
    • Google PageSpeed
    • Refusal & Targeted ads
    • Mozilla and adblocks
    • Wordpress, Joomla, etc ...
    • Shopify
    • Pricing
      • The Two Types of Licenses
      • What happens when I reach the limit of my monthly plan?
      • Do you offer a trial period?
      • What are the accepted payment methods?
      • Do you offer packages for very high volumes of hits?
      • Are unused hits carried over to the next month?
      • What is considered a Hit?
      • Can I change plans?
    • Content Security Policy (CSP)
    • Google
      • Problem gclid google
      • Google extensions
    • How to Verify the Integration of My CMP?
    • How to Identify the Cookies Present on Your Website?
    • Abconsent CMP is compatible with Taggr ?
  • CMP Services
    • CMP Configuration
    • CMP Integration
    • Tag Conditioning
    • Compliance audit
    • Extra-vendorlist
    • Video-Wall
    • Inventory Partners
    • Consulting
  • Links
    • Configure your CMP
    • Sirdata API
    • Semantic API
    • About Sirdata
    • Analytics Helper
Propulsé par GitBook
Sur cette page
  • PingReturn
  • TCData
  • GlobalVendorList
  • Events

Cet article vous a-t-il été utile ?

  1. CMP API

How it works

In this section you will find the JavaScript commands allowing you to interact with the CMP on your site.

PrécédentMicrosoft Clarity ConsentSuivantExamples

Dernière mise à jour il y a 3 mois

Cet article vous a-t-il été utile ?

All commands can be executed through the API function __sdcmpapi, and Sirdata CMP provides a list of standard commands described in the .

If you are using a version compatible with the Transparency and Consent Framework (TCF) (this is the default), the commands can also be executed through the API function __tcfapi.

window.__sdcmpapi(command, version, callback, parameter);
window.__tcfapi(command, version, callback, parameter);

The version parameter is the TCF specification version (= 2).

Command

Callback

Parameter

Description

ping

function(PingReturn, success)

-

Returns information about the CMP loading status and the GDPR application mode.

revokeUtiq

function(success)

-

Remove the existing consent for the Utiq partner and the associated purpose. The associated signal and the CMP UI (in case of redisplay) are updated.

Returns true if Utiq and the associated purpose are part of the CMP configuration, and false otherwise.

getVendorList

function(GlobalVendorList, success)

vendorListVersion (int) - optionnel Global Vendor List version to fetch. If undefined, the version used by Sirdata CMP is returned. If value is LATEST, the latest available version is returned. If value is invalid, GlobalVendorList will be null and success will be false.

Returns the Global Vendor List containing the purposes and vendors participating in the Transparency & Consent Framework.

addEventListener

function(TCData, success)

-

Add a JavaScript function to call with TC Data whenever a CMP event occurs.

removeEventListener

function(success)

listenerId (int) Listener ID to remove.

Remove a listener previously added with the addEventListener command.

PingReturn

{
    gdprApplies: *Boolean*,
    cmpLoaded: *Boolean*,
    cmpStatus: *String*,
    displayStatus: *String*,
    apiVersion: '2.0',
    cmpVersion: *Integer*,
    cmpId: *Integer*,
    gvlVersion: *Integer*,
    tcfPolicyVersion: *Integer*
}

TCData

{
    tcString: [base64url-encoded] *String*,
    addtlConsent: *String*,
    tcfPolicyVersion: *Integer*,
    cmpId: *Integer*,
    cmpVersion: *Integer*,
    gdprApplies: *Boolean*,
    evenStatus: *String*,
    cmpStatus: *String*,
    isServiceSpecific: *Boolean*,
    useNonStandardStacks: *Boolean*,
    publisherCC: *String*,
    purposeOneTreatment: *Boolean*,
    outOfBand: {
        allowedVendors: {
            *vendorId*: *Boolean*,
            ?
        },
        disclosedVendors: {
            *vendorId*: *Boolean*,
            ?
        }
    },
    purpose: {
        consents: {
            *purposeId*: *Boolean*,
            ?
        },
        legitimateInterests: {
            *purposeId*: *Boolean*,
            ?
        }
    },
    vendor: {
        consents: {
            *vendorId* : *Boolean*,
            ?
        },
        legitimateInterests: {
            *vendorId* : *Boolean*,
            ?
        }
    },
    specialFeatureOptins: {
        *specialFeatureId*: *Boolean*,
        ?
    },
    publisher: {
        consents: {
            *purposeId*: *Boolean*,
            ?
        },
        legitimateInterests: {
            *purposeId*: *Boolean*,
            ?
        },
        customPurpose: {
            consents: {
                *customPurposeId*: *Boolean*,
                ?
            },
            legitimateInterests: {
                *customPurposeId*: *Boolean*,
                ?
            }
        },
        restrictions: {
            *purposeId*: {
                *vendorId* : *Integer*,
                ?
            },
            ?
        }
    }
}

GlobalVendorList

{
    gvlSpecificationVersion: *Integer*,
    vendorListVersion: *Integer*,
    tcfPolicyVersion: *Integer*,
    lastUpdated: *String*,
    purposes: {
        *purposeId*: {
            id: *Integer*,
            name: *String*,
            description: *String*,
            descriptionLegal: *String*,
        },
        ?
    },
    specialPurposes: {
        *specialPurposeId*: {
            id: *Integer*,
            name: *String*,
            description: *String*,
            descriptionLegal: *String*,
        },
        ?
    },
    features: {
        *featureId*: {
            id: *Integer*,
            name: *String*,
            description: *String*,
            descriptionLegal: *String*,
        },
        ?
    },
    specialFeatures: {
        *specialFeatureId*: {
            id: *Integer*,
            name: *String*,
            description: *String*,
            descriptionLegal: *String*,
        },
        ?
    },
    stacks: {
        *stackId*: {
            id: *Integer*,
            name: *String*,
            description: *String*,
            purposes: [
                *Integer*,
                ?
            ],
            specialFeatures: [
                *Integer*,
                ?
            ],
        },
        ?
    },
    vendors: {
        *vendorId*: {
        {
            id: *Integer*,
            name: *String*,
            purposes: [
                *Integer*,
                ?
            ],
            legIntPurposes: [
                *Integer*,
                ?
            ],
            flexiblePurposes: [
                *Integer*,
                ?
            ],
            specialPurposes: [
                *Integer*,
                ?
            ],
            features: [
                *Integer*,
                ?
            ],
            specialFeatures: [
                *Integer*,
                ?
            ],
            policyUrl: *String*,
            usesCookies: *Boolean*,
            cookieMaxAgeSeconds: *Integer*,            
            usesNonCookieAccess: *Boolean*,
            deviceStorageDisclosureUrl: *String*
        },
        ?
    }
}

Events

You will find in the table below the list of events that can be triggered by the CMP:

Event

Description

tcloaded

This event status is triggered when the CMP is loaded, a valid TC String is available and the UI is not surfaced.

cmpuishown

This event status is triggered when the UI is surfaced or re-surfaced. If there's no existing TC String for the user, the CMP creates a TC String with all legitimate interest signals set to true and all the consent signals set to false.

useractioncomplete

This event status is triggered whenever a user has confirmed or re-confirmed their choices and the updated TC String is ready to be surfaced.

cmpuiclosed

This event status is triggered when a user closes the surfaced UI by clicking on the close button (if enabled) and thus the current TC String is unmodified by the CMP.

IAB Tech Lab CMP JavaScript API
See the list of events