MoPub マーケットプレイスと特定の広告ネットワークでは、ユーザーの位置情報を使ってさらに広告を絞り込むことができます。 アプリとSDKで位置情報の取得が有効になっている場合、SDKは経度と緯度情報を自動的に送信します。
アプリでは位置情報を使用しており、しかしMoPubへは位置情報を渡したくない場合は、`com.mopub.comon.MoPub`クラスの位置情報に関するメソッドを使用してください:
package org.myapp import com.mopub.common.MoPub; class MyActivity extends Activity { @Override public void onCreate { ... MoPub.setLocationAwareness(MoPub.LocationAwareness.DISABLED); ... } }
バナー広告やインタースティシャル広告のadview上では、では、コンマ区切りの一覧にしたキーワードをアプリからMoPub へ渡します。 キーワードはキーと値の組み合わせ(例えば m_age:24) の形式にする必要があります。 “&” と “=”を除く、任意の文字が使用できます。スペースは使用でき、特殊文字は非推奨です。
MoPubView moPubView = (MoPubView) findViewById(R.id.mopubview); moPubView.setAdUnitId("AD_UNIT_ID"); moPubView.setKeywords("m_age:24,m_gender:m,m_marital:single"); moPubView.loadAd();
Using the same key value pairs, target campaigns using the keyword targeting function in the Advanced Targeting dropdown. 複数のキーワードを対象にするには、 ANDを使用します。OR 句を使用したい場合は、キーワードを改行で分けます。プロパティを明示的に対象としない場合は、キーワードの前に“-”を付けます。
ANDのサンプル: m_gender:m AND m_age:25注意: ネイティブ広告では、RequestParameters クラスを使ってキーワードを渡すことができます。
Data PassingPassing Latitude and LongitudeThe 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 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, use the location methods on the `com.mopub.comon.MoPub` class: package org.myapp import com.mopub.common.MoPub; class MyActivity extends Activity { @Override public void onCreate { ... MoPub.setLocationAwareness(MoPub.LocationAwareness.DISABLED); ... } } Passing KeywordsFor banner and interstitial ads, pass the keywords from your app to MoPub as a comma-separated list in the ad view. They should be formatted as key/value pairs (e.g. m_age:24). You can use any character except “&” and “=”. Spaces are allowed, and special characters are discouraged. MoPubView moPubView = (MoPubView) findViewById(R.id.mopubview); moPubView.setAdUnitId("AD_UNIT_ID"); moPubView.setKeywords("m_age:24,m_gender:m,m_marital:single"); moPubView.loadAd(); Using the same key value pairs, target campaigns using the keyword targeting function in the Advanced Targeting dropdown. To target multiple keywords, use AND. If you want to use the OR clause, separate the keywords by a new line. To explicitly not target a property, put a “-” in front of the keyword. Example: m_gender:m AND m_age:25Example: m_gender:m m_age:25 Negative Targeting: -m_age:25 Note: For native ads, you can pass in keywords using the RequestParameters class. |