This topic outlines various InMobi CMP Web SDK callbacks, designed to empower publishers with the information needed for seamless integration and consent details retrieval.
Pings the CMP state and checks whether the _tcfapi
is operational.
Attribute | Data Type | Description |
---|---|---|
pingData |
Object | Contains cmpId , cmpVersion , gdprApplies , tcfPolicyVersion , cmpLoaded , cmpStatus , displayStatus , apiVersion , gvlVersion . |
__tcfapi('ping', 2, function(pingData) { console.log('cmp responded:', pingData);});
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.
Attribute | Data Type | Description |
---|---|---|
tcData |
String | Fully encoded consent string that the CMP has set. |
success |
Boolean | Boolean for status. |
__tcfapi('getTCData', 2, function(tcData, success) { console.log('cmp responded:', tcData, success);});
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.
Attribute | Data Type | Description |
---|---|---|
tcData |
String | Fully encoded consent string that the CMP has set. |
success |
Boolean | Boolean for status. |
__tcfapi('addEventListener', 2, function(tcData, success) { console.log('cmp responded:', tcData, success);});
Find out the user’s consent preference for non-IAB Vendor list.
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. |
__tcfapi('getNonIABVendorConsents',2, function(consent, success) { console.log('cmp responded:', consent, success);});
Hard re-prompt of the CMP on the website, outside of the Persistent Consent Link feature.
__tcfapi('displayConsentUi',2, function() {});
Returns the full configurations of the CMP for debugging purposes.
Attribute | Data Type | Description |
---|---|---|
config |
Object | Contains the coreConfig , coreUiLabels , nonIabVendorsInfo , premiumProperties , premiumUiLabels , themes. |
__tcfapi('getNonIABVendorConsents',2, function(consent, success) { console.log('cmp responded:', consent, success);});
Returns USP Data and Success. Success is either “true” or “false”.
Attribute | Data Type | Description |
---|---|---|
uspData |
String | Contains uspString and version. |
success |
Boolean | Status of the uspString |
__uspapi("getUSPData", 1, function(uspData, success) { console.log('cmp responded:', uspData, success);});
This will display the U.S Privacy UI (modal dialog).It will inherit style and style overrides given in the config object.
__uspapi("displayUspUi");
Pings the CMP state and checks whether the _tcpapi
is operational.
Attribute | Data Type | Description |
---|---|---|
uspData |
String | Contains cmpLoaded , jurisdiction, location, and mode. |
success |
Boolean | Status of the uspData |
__uspapi("uspPing", 1, function(uspData, success) { console.log('cmp responded:', uspData, success);});
By installing this SDK update, you agree that your Children Privacy Compliance setting remains accurate or that you will update that setting, whenever there is a change in your app's audience. You may update the app's Children Privacy Compliance settings at https://publisher.inmobi.com/my-inventory/app-and-placements.