Web

This topic outlines various InMobi CMP Web SDK callbacks, designed to empower publishers with the information needed for seamless integration and consent details retrieval. 

Cmp Ping

Purpose

Pings the CMP state and checks whether the _tcfapi is operational.

Parameters

Attribute Data Type Description
pingData Object Contains cmpId, cmpVersion, gdprApplies, tcfPolicyVersion, cmpLoaded, cmpStatus, displayStatus, apiVersion, gvlVersion.

Example

__tcfapi('ping', 2, function(pingData) { console.log('cmp responded:', pingData);});

Synchronous Consent String API

Purpose

Get the full encoded consent string that the CMP has set on the browser page. This is a synchronous call resolved immediately after it is called.

Parameters

Attribute Data Type Description
tcData String Fully encoded consent string that the CMP has set.
success Boolean Boolean for status.

Example

__tcfapi('getTCData', 2, function(tcData, success) { console.log('cmp responded:', tcData, success);});

Asynchronous Consent String API

Purpose

Add an event listener to the consent string object that the CMP has set on the browser page. This is intended to be an asynchronous call performed by the CMP after certain conditions are met.

Parameters

Attribute Data Type Description
tcData String Fully encoded consent string that the CMP has set.
success Boolean Boolean for status.

Example

__tcfapi('addEventListener', 2, function(tcData, success) { console.log('cmp responded:', tcData, success);});

Non-IAB Vendor API

Purpose

Find out the user’s consent preference for non-IAB Vendor list.

Parameters

Attribute Data Type Description
getNonIABVendorConsents String Indicates that the function is requesting non-IAB vendor consents.
consent String Represents the data related to non-IAB vendor consents.
success Boolean Indicates whether the getNonIABVendorConsents action was successful or not.

Example

__tcfapi('getNonIABVendorConsents',2, function(consent, success) { console.log('cmp responded:', consent, success);});

Reprompt CMP API

Purpose

Hard re-prompt of the CMP on the website, outside of the Persistent Consent Link feature.

Example

__tcfapi('displayConsentUi',2, function() {});

CMP Configuration API

Purpose

Returns the full configurations of the CMP for debugging purposes.

Parameters

Attribute Data Type Description
config Object Contains the coreConfig, coreUiLabels, nonIabVendorsInfo, premiumProperties, premiumUiLabels, themes.

Example

__tcfapi('getNonIABVendorConsents',2, function(consent, success) { console.log('cmp responded:', consent, success);});

Get USP Data API

Purpose

Returns USP Data and Success. Success is either “true” or “false”.

Parameters

Attribute Data Type Description
uspData String Contains uspString and version.
success Boolean Status of the uspString

Example

__uspapi("getUSPData", 1, function(uspData, success) { console.log('cmp responded:', uspData, success);});

Display USP API

Purpose

This will display the U.S Privacy UI (modal dialog).It will inherit style and style overrides given in the config object.

Example

__uspapi("displayUspUi");

USP Ping API

Purpose

Pings the CMP state and checks whether the _tcpapi is operational.

Parameters

Attribute Data Type Description
uspData String Contains cmpLoaded, jurisdiction, location, and mode.
success Boolean Status of the uspData

Example

__uspapi("uspPing", 1, function(uspData, success) { console.log('cmp responded:', uspData, success);});

On This Page

Last Updated on: 27 Mar, 2024