/**
* 1. Get the key from localStorage which start with amp-store
* 2. Parse the value and convert into JSON.
* 3. Once parsed, access the property 'amp-consent:inmobi'
* 4. Split the GPP string, and retrieve the TCF string which you can use.
* 5. Add proper handling and test before pushing the below code to production
* 6. For more details on how to access local storage, please look at amp-script documentation (https://amp.dev/documentation/components/amp-script)
*/
let consent = JSON.parse(atob(localStorage.getItem('<key-from-domain-local-storage>'))); //looks like this amp-store:https://deranged-humorr.surge.sh
if (consent && consent.vv) {
const gppString = consent.vv['amp-consent:inmobi'].v.r;
const gppStringArray = gppString.split('~');
for(let i = 0; i < gppStringArray.length; i++) {
if (gppStringArray[i].startsWith('CP')) {
console.log('TCF String is ', gppStringArray[i]);
}
}
}
Only MSPA signatories can mark transactions as Covered. You can check your signatory status and sign the MSPA here.
This section outlines the various APIs and callbacks that publishers can use to trigger the MSPA consent screen once they are integrated with GPP.
The purpose of this callback is to know if the user has changed the location and retrigger the MSPA consent screen based on the new location.
Attribute | Data Type | Description |
locationChanged |
Boolean | Whether user has changed the location or not. |
previousLocation |
String |
Two letter region string like ca, va, ct, co, etc. |
currentLocation |
String |
Two letter region string like ca, va, ct, co, etc. |
window.__uspapi(isUserLocationChanged, 1, (result) => {
console.log(result); // { locationChanged: true, previousLocation: ‘va’, currentLocation: ‘ca’}
});
This will display the U.S Privacy UI (modal dialog). It will inherit style and style overrides given in the config object.
window.__uspapi('displayUspUi', 1, function(data, status) { console.log(data, status); })
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.