Data Passing

As of the 5.0 SDK release, MoPub provides a field for publishers to send personal data. Publisher Partners must send any demographic or interest-based targeting data in the fields designated for such data, as described below. Publisher Partners must not include any personal data, including demographic or interest-based targeting data, in any fields intended for contextual targeting (that is, targeting based on the content of the app). Additionally, publishers must not send MoPub any keywords that are against the MoPub Privacy Policies.

Passing Personal Data

As of the 5.0 SDK release, the MoPub SDK exposes an additional keyword API (setUserDataKeywords()) for publishers to send personal data. Publisher Partners must send any demographic or interest-based targeting data (m_age:24) in this field.

Passing Non-Personal Data

You can continue to pass contextual keywords via the setKeywords() API.

Passing Keywords

Pass the keywords from your app to MoPub as a comma-separated list in the ad view. Format each keyword as a key-value pair (for example, m_age:24). You can use any characters except & and =.

Banners and Interstitials

MoPubView moPubView;

moPubView.setAdUnitId("AD_UNIT_ID");
moPubView.setKeywords("CONTEXTUAL_KEYWORDS");
moPubView.setUserDataKeywords("USER_DATA_KEYWORDS");
moPubView.loadAd();

Rewarded Videos

import com.mopub.mobileads.MoPubRewardedVideoManager.RequestParameters;

MoPubRewardedVideos.loadRewardedVideo("AD_UNIT_ID",
                        new RequestParameters("CONTEXTUAL_KEYWORDS", "USER_DATA_KEYWORDS", "LOCATION", "CUSTOMER_ID"));

Native Ads

import com.mopub.nativeads.RequestParameters;

RequestParameters mRequestParameters;

mRequestParameters = new RequestParameters.Builder()
                        .location(location)
                        .keywords("CONTEXTUAL_KEYWORDS")
                        .userDataKeywords("USER_DATA_KEYWORDS")
                        .desiredAssets(desiredAssets)
                        .build();

"YOUR_AD_ADAPTER".loadAds("AD_UNIT_ID", mRequestParameters);

Passing Location

The MoPub Marketplace and certain ad networks can use your user’s location to send more targeted ads. Our SDK will automatically pass over latitude and longitude coordinates if they are available in the app and enabled in the SDK.

If you use location in your app, but would like to disable location passing to MoPub, you can do the following:

MoPub.setLocationAwareness(MoPub.LocationAwareness.DISABLED);

Targeting

Using the same key-value pairs, target campaigns using the keyword targeting function in the Advanced Targeting dropdown. To target multiple keywords, use AND (e.g. m_gender:m AND m_age:25). If you want to use the OR clause, separate the keywords by a new line.

Best Practices

When in doubt, you can always call MoPub.canCollectPersonalInformation() to determine if you should be processing any personal data. If you are using MoPub mediation, adapters have already been modified to let the mediated SDKs know whether they, too, can collect and process users’ personal data.

Last updated November 17, 2018

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2018 MoPub Inc.