Implementation

Enabling GPP and MSPA

Implementation Steps for Existing and New Signatories

  1. Before you begin enabling GPP and MSPA, upgrade to v54 or latest.
  2. For GDPR, select TCF, GPP, or Both (recommended).

  3. Enabling both GPP and TCF doesn't work for AMP sites where only the GPP string will be stored. To extract the TCF string from GPP, use the code below:
    /**  
     * 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]);
            }
        }
    }
    	
  4. To implement MSPA, update your signatory status and regulatory path.

    Note

    Only MSPA signatories can mark transactions as Covered. You can check your signatory status and sign the MSPA here.

  5. Select the relevant opt-outs among personal, sensitive, and child data consents.

  6. The end-user is shown the consent screen based on the consents selected by you.

  7. The GPP string is stored under the key name (IABGPP_HDR_GppString).

APIs to Trigger MSPA Consent Screen

This section outlines the various APIs and callbacks that publishers can use to trigger the MSPA consent screen once they are integrated with GPP.

isUserLocationChanged

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.

Parameters

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.

Example


window.__uspapi(isUserLocationChanged, 1, (result) => {
    console.log(result); // { locationChanged: true, previousLocation: ‘va’, currentLocation: ‘ca’}
});

displayUspUi

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

Example


window.__uspapi('displayUspUi', 1, function(data, status) { console.log(data, status); })

On This Page

Last Updated on: 11 Jun, 2024