User Privacy

Last Updated on: 22 Sep, 2023

INFO

If you are integrating the Meson SDK for the first time, we recommend skipping the Update SDK from 1.0.0-beta32 and below to 1.0.0-beta33 section and proceeding with the remaining integration steps.

Update SDK from 1.0.0-beta32 and below to 1.0.0-beta33

Beginning with SDK version 1.0.0-beta33, we've enhanced the user signal-gathering process for GDPR and COPPA compliance by consolidating them into a single API. This eliminates the necessity for multiple API calls and offers publishers a centralized solution for comprehensive consent management.

Make sure that you replace the old SDK with the new one.

Old SDK

Kotlin

//GDPR settings from your CMP 
val gdprConsent = JSONObject().run { 
    put(MesonSdk.MES_GDPR_CONSENT_AVAILABLE, true) //consent value that is obtained from User 
    put(MesonSdk.MES_GDPR_CONSENT_GDPR_APPLIES, "0") //0 if GDPR is not applicable and 1 if applicable 
    put(MesonSdk.MES_GDPR_CONSENT_IAB, "<IAB String v1 or v2>")//user consent in IAB format 
} 
//set GDPR Consent via MesonSdkConfiguration.Builder
val mesonSdkConfiguration = MesonSdkConfiguration.Builder(this, "<MESON_APP_ID>").setConsent(gdprConsent).build()  

//CCPA 
private fun setExtras() {
// You can notify Meson that restricted data processing is enabled using either of the following parameters.
       val extras = JSONObject()
       extras.run{
           put("rdp", false)
           put("iab_usprivacy_string", "1YNN")
       }
       MesonSdk.setExtras(extras)
}

Java

//GDPR settings from your CMP 
JSONObject pubConsent = new JSONObject(); 
try { 
    //consent value that is obtained from User 
    pubConsent.put(MesonSdk.Companion.getMES_GDPR_CONSENT_AVAILABLE(), true); 
    //0 if GDPR is not applicable and 1 if applicable 
    pubConsent.put(MesonSdk.Companion.getMES_GDPR_CONSENT_GDPR_APPLIES(), "0"); 
    //user consent in IAB format 
    pubConsent.put(MesonSdk.Companion.getMES_GDPR_CONSENT_IAB(), "<IAB String v2 or v1>"); 
} catch (JSONException e) { 
    e.printStackTrace(); 
}  
//set GDPR Consent via MesonSdkConfiguration.Builder
MesonSdkConfiguration mesonSdkConfiguration = new MesonSdkConfiguration.Builder(getApplicationContext(), "<MESON_APP_ID>").setConsent(pubConsent).build();  


//CCPA
public void setExtras() {
// You can notify Meson that restricted data processing is enabled using either of the following parameters.
  JSONObject extras = new JSONObject();
    extras.put("rdp", false);
    extras.put("iab_usprivacy_string", "1YNN");

  MesonSdk.Companion.setExtras(extras);
}

New SDK

Kotlin

val consent = JSONObject().apply {
   //GDPR - You should send the GDPR consent either in a simple format using MesonConstants.CONSENT_GDPR_PUB or in IAB format using MesonConstants.CONSENT_GDPR_CONSENT.
    put(MesonConstants.CONSENT_GDPR_PUB, 1)
    put(MesonConstants.CONSENT_GDPR, 0)
    put(MesonConstants.CONSENT_GDPR_CONSENT, "<IABV1> OR <IABV2>")
    //CCPA - You can notify Meson that restricted data processing in a simple format using MesonConstants.CONSENT_DO_NOT_SELL or in IAB format using MesonConstants.CONSENT_US_PRIVACY.
    put(MesonConstants.CONSENT_DO_NOT_SELL, false)
    put(MesonConstants.CONSENT_US_PRIVACY, "1YNN")
}
MesonSdk.setConsent(consent)

Java

JSONObject consent = null;
try {
    consent = new JSONObject()
            //GDPR - You should send the GDPR consent either in a simple format using MesonConstants.CONSENT_GDPR_PUB or in IAB format using MesonConstants.CONSENT_GDPR_CONSENT.
            .put(MesonConstants.CONSENT_GDPR_PUB, 1)
            .put(MesonConstants.CONSENT_GDPR, 0)
            .put(MesonConstants.CONSENT_GDPR_CONSENT, "<IABV1> OR <IABV2>")
            //CCPA - You can notify Meson that restricted data processing in a simple format using MesonConstants.CONSENT_DO_NOT_SELL or in IAB format using MesonConstants.CONSENT_US_PRIVACY.
            .put(MesonConstants.CONSENT_DO_NOT_SELL, false);
            .put(MesonConstants.CONSENT_US_PRIVACY, "1YNN")
} catch (JSONException e) {
     //handle exception
}
MesonSdk.Companion.setConsent(consent);

API

  • In the provided code snippet, the traditional method of establishing consent through the MesonSdkConfiguration.Builder API is substituted with the new MesonSdk.setConsent(consentObject: JSONObject?) API. If you previously relied on MesonSdk.updateGDPRConsent(consentObject: JSONObject?) for consent management, we recommend making the switch to the new MesonSdk.setConsent(consentObject: JSONObject?) API.
  • In beta32 and below, CCPA user signals were set via setExtras API, which has been changed in the new SDK to be sent via the aforementioned setConsent API. Delete the older way of sending the CCPA user signals.

Constants

In the above snippet, the old constants have been replaced with new constants, and the data type of a few values has been changed as follows:

Old Constant New Constant Old Value Data Type New Value Data Type
MesonSdk.MES_GDPR_CONSENT_AVAILABLE MesonConstants.CONSENT_GDPR_PUB Boolean Integer
MesonSdk.MES_GDPR_CONSENT_IAB MesonConstants.CONSENT_GDPR_CONSENT No Change
MesonSdk.MES_GDPR_CONSENT_GDPR_APPLIES MesonConstants.CONSENT_GDPR String Integer
iab_usprivacy_string MesonConstants.CONSENT_US_PRIVACY No Change
rdp MesonConstants.CONSENT_DO_NOT_SELL No Change

Added APIs

  • MesonSdk.setConsent(consentObject: JSONObject?)
  • MesonSdk.getConsent()

GDPR

You can agree or deny the GDPR compliance at the account and app level. For more information about the setup at the account level, see Privacy & Compliance, and for the app level, see Select GDPR and COPPA settings.

If you opt to transmit user signals pertaining to GDPR, Meson SDK offers a solution to align with GDPR guidelines. With the help of setConsent API, you can conveniently employ the following keys to transmit the corresponding values, thus ensuring compliance with GDPR regulations.

INFO

You should send the GDPR consent in a simple format using MesonConstants.CONSENT_GDPR_PUB or in IAB format using MesonConstants.CONSENT_GDPR_CONSENT.

Keys Values Description
MesonConstants.CONSENT_GDPR_PUB 0 or 1 (Integer) 0 - Denied.
1 - consented
Any other value - Considered Denied.
MesonConstants.CONSENT_GDPR 0 or 1 (Integer) 0  - GDPR applies in this region.
1  -  GDPR does not apply.
MesonConstants.CONSENT_GDPR_CONSENT “ConsentString in V1 format“ (String) OR “ConsentString in V2 format“ (String) For more information, see IAB specification.
Note: If any CMP is used to collect info, SDK reads that info from shared preferences.

CCPA

You can choose to restrict data processing at an App level. For more information, see Select GDPR and COPPA settings.

If you opt to transmit user signals concerning CCPA, Meson SDK facilitates compliance with the California Consumer Privacy Act (CCPA).

INFO

Meson SDK allows you to employ either of the following keys through the setConsent API to effortlessly enable or disable restricted data processing (RDP), aligning with CCPA regulations.

Keys Values Description
MesonConstants.CONSENT_US_PRIVACY “1YNN“ (String)
For demo purposes only
For more information on signaling restricted data processing, see IAB specification.
Any other value - Considered Denied.
MesonConstants.CONSENT_DO_NOT_SETLL True or false (Boolean) True - user opted out of the sale of his or her personal information.
False - Do Not restrict the processing of user data.

After configuring GDPR and COPPA settings, the final snippet will resemble the example provided below:

Kotlin

val consent = JSONObject().apply {
   //GDPR - You should send the GDPR consent either in a simple format using MesonConstants.CONSENT_GDPR_PUB or in IAB format using MesonConstants.CONSENT_GDPR_CONSENT.
    put(MesonConstants.CONSENT_GDPR_PUB, 1)
    put(MesonConstants.CONSENT_GDPR, 0)
    put(MesonConstants.CONSENT_GDPR_CONSENT, "<IABV1> OR <IABV2>")
    //CCPA - You can notify Meson that restricted data processing in a simple format using MesonConstants.CONSENT_DO_NOT_SELL or in IAB format using MesonConstants.CONSENT_US_PRIVACY.
    put(MesonConstants.CONSENT_DO_NOT_SELL, false)
    put(MesonConstants.CONSENT_US_PRIVACY, "1YNN")
}
MesonSdk.setConsent(consent)

Java

JSONObject consent = null;
try {
    consent = new JSONObject()
            //GDPR - You should send the GDPR consent either in a simple format using MesonConstants.CONSENT_GDPR_PUB or in IAB format using MesonConstants.CONSENT_GDPR_CONSENT.
            .put(MesonConstants.CONSENT_GDPR_PUB, 1)
            .put(MesonConstants.CONSENT_GDPR, 0)
            .put(MesonConstants.CONSENT_GDPR_CONSENT, "<IABV1> OR <IABV2>")
            //CCPA - You can notify Meson that restricted data processing in a simple format using MesonConstants.CONSENT_DO_NOT_SELL or in IAB format using MesonConstants.CONSENT_US_PRIVACY.
            .put(MesonConstants.CONSENT_DO_NOT_SELL, false);
            .put(MesonConstants.CONSENT_US_PRIVACY, "1YNN")
} catch (JSONException e) {
     //handle exception
}
MesonSdk.Companion.setConsent(consent);

Retrieve Consent Signals

To access consent signals at any point in time, employ the following code snippet:

Kotlin

val consent = MesonSdk.getConsent()

Java

JSONObject consent = MesonSdk.Companion.getConsent();