PMAdRequest

Document created by david.simerly on Nov 20, 2017Last modified by david.simerly on Apr 3, 2018
Version 2Show Document
  • View in full screen mode

PubMatic SDKs

AdRequest

NativeAdSize

PMAdRendered

➤ PMAdRequest

PMAdRequest.AD_TYPE

PMAdRequest.AWT_OPTION

PMAdRequest.ETHNICITY

PMAdRequest.GENDER

PMAdRequest.HASHING_TECHNIQUE

PMAdRequest.OPERID

PMAdRequest.RS

PMAdSize

PMAdSize

PMBannerAdRequest

PMBannerAdView

PMBannerAdView.BannerAdViewDelegate

PMBannerAdView.BannerAdViewDelegate.
     ActivityListener

PMBannerAdView.BannerAdViewDelegate.
     FeatureSupportHandler

PMBannerAdView.BannerAdViewDelegate.
     InternalBrowserListener

PMBannerAdView.BannerAdViewDelegate.
     RequestListener

PMBannerAdView.BannerAdViewDelegate.
     RichMediaListener

PMBannerImpression

PMBid

PMError

PMImpression

PMInterstitialAd

PMInterstitialAd.InterstitialAdListener

PMInterstitialAd.InterstitialAdListener.
     ActivityListener

PMInterstitialAd.InterstitialAdListener.
     FeatureSupportHandler

PMInterstitialAd.InterstitialAdListener.
     InternalBrowserListener

PMInterstitialAd.InterstitialAdListener.
     RequestListener

PMInterstitialAd.InterstitialAdListener.
     RichMediaListener

PMInterstitialAdRequest

PMLogger

PMLogger.LogListener

PMLogger.PMLogLevel

PMNativeAd

PMNativeAd.Image

PMNativeAd.NativeRequestListener

PMNativeAdRequest

PMNativeAssetRequest

PMNativeAssetResponse

PMNativeDataAssetRequest

PMNativeDataAssetResponse

PMNativeDataAssetTypes

PMNativeImageAssetRequest

PMNativeImageAssetResponse

PMNativeImageAssetTypes

PMNativeTitleAssetRequest

PMNativeTitleAssetResponse

PMPrefetchManager

PMPrefetchManager.PMPrefetchListener

PMPrefetchRequest

PubMaticSDK


PubMatic Android SDK Guide

com.pubmatic.sdk.common.pubmatic

Class PMAdRequest

java.lang.Object
    com.pubmatic.sdk.common.AdRequest
        com.pubmatic.sdk.common.pubmatic.PMAdRequest

 

Direct Known Subclasses:
PMBannerAdRequest, PMNativeAdRequest

public abstract class PMAdRequest
extends AdRequest

 

Abstract class for PubMatic (SSP) channel ad requests (e.g. PMBannerAdRequest, PMNativeAdRequest etc)

 

Nested Class Summary

Modifier and TypeClass and Description
protected static class PMAdRequest.AD_TYPE 
protected static class PMAdRequest.AWT_OPTION Indicates whether the tracking URL has been wrapped or not in the creative tag.
static class PMAdRequest.ETHNICITY The user’s ethnicity may be used to deliver more relevant ads.
static class PMAdRequest.GENDER 
static class PMAdRequest.HASHING_TECHNIQUE 
protected static class PMAdRequest.OPERID 
protected static class PMAdRequest.RS 

 

Field Summary

Modifier and TypeField and Description
protected java.lang.stringmAdId 
protected java.lang.stringmAdOrientation 
protected PMAdRequest.AD_TYPEmAdType 
protected java.lang.stringmAid 
protected java.lang.stringmAppCategory 
protected java.lang.stringmAppDomain 
protected PMAdRequest.AWT_OPTIONmAWT 
protected java.lang.stringmCity 
protected java.lang.BooleanmCoppa 
protected java.lang.stringmDMA 
protected PMAdRequest.ETHNICITYmEthnicity 
protected PMAdRequest.GENDERmGender 
protected PMAdRequest.HASHING_TECHNIQUEmHashing 
protected java.lang.stringmIABCategory 
protected java.lang.stringmIncome 
protected java.util.ArrayList<java.lang.string>mKeywordsList 
protected PMAdRequest.OPERIDmOperId 
protected intmOrmmaComplianceLevel 
protected java.lang.BooleanmPaid 
protected java.lang.stringmPMZoneId 
protected java.lang.stringmPubId 
protected java.lang.stringmSiteId 
protected java.lang.stringmState 
protected java.lang.stringmStoreURL 
protected java.lang.stringmYearOfBirth 
protected java.lang.stringmZip 

 

Fields inherited from class com.pubmatic.sdk.common.AdRequest


isAndroidAidEnabled, mChannel, mContext, mCustomParams, mLocation, mPMAdSize, mPostData, mRRFormatter, mUrlParams, mUserAgent

 

Constructor Summary

ModifierConstructor and Description
protected PMAdRequest() 

 

Method Summary

Modifier and TypeMethod and Description
voidaddKeyword(java.lang.string keyword) Add the new keyword that the user might be interested in.
BooleancheckMandatoryParams() 
java.lang.stringgetAdId() Getter for ID of the publisher's ad tag ID.
java.lang.stringgetAdOrientation() 
java.lang.stringgetAdServerURL() Returns the base/host name URL
protected PMAdRequest.AD_TYPEgetAdType() 
java.lang.stringgetAid() It is not in use.
java.lang.stringgetAppCategory() 
java.lang.stringgetAppDomain() 
protected PMAdRequest.AWT_OPTIONgetAWT() 
java.lang.stringgetCity() 
intgetDeviceOrientation(android.content.Context context) 
protected java.lang.stringgetDMA() 
PMAdRequest.ETHNICITYgetEthnicity() 
PMAdRequest.GENDERgetGender() 
java.lang.stringgetIABCategory() 
java.lang.stringgetIncome() Returns the income of the user.
java.lang.stringgetKeywordstring() Returns the keywords list in the form of comma separated string.
android.location.LocationgetLocation() Return the location of the user.
protected PMAdRequest.OPERIDgetOperId() 
intgetOrmmaComplianceLevel() 
java.lang.stringgetPMZoneId() 
java.lang.stringgetPubId() Getter for ID of the publisher.
java.lang.stringgetSiteId() Getter for ID of the publisher's site/app.
java.lang.stringgetState() 
java.lang.stringgetStoreURL() 
PMAdRequest.HASHING_TECHNIQUEgetUdidHash() 
java.lang.stringgetYearOfBirth() Returns the year of birth of the user.
java.lang.stringgetZip() 
java.lang.BooleanisApplicationPaid() Indicates whether the mobile application is a paid version or not.
java.lang.BooleanisCoppa() 
protected voidsetAdId(java.lang.string adTagId) AdTagId is associated with the Banner Ad Size.
voidsetAdOrientation(java.lang.string mAdOrientation) Set the ad orientation.
protected voidPMAdRequest.AD_TYPE mAdType) 
voidsetAid(java.lang.string mAid) It is not in use.
voidsetAppCategory(java.lang.string mAppCategory) Application primary category as displayed on storeurl page for the respective platform
voidsetAppDomain(java.lang.string appDomain) Indicates the domain of the mobile application
voidsetApplicationPaid(Boolean paid) Indicates whether the mobile application is a paid version or not.
protected voidPMAdRequest.AWT_OPTION mAWT) 
voidsetCity(java.lang.string city) Sets city of the user.
voidsetCoppa(Boolean mCoppa) Indicates whether the visitor is COPPA-specific or not.
voidsetDMA(java.lang.string mDMA) Designated market area (DMA) code of the user.
voidPMAdRequest.ETHNICITY ethnicity) Numeric code of ethnicity.
voidPMAdRequest.GENDER gender) Set Gender of the user to deliver more relevant ads.
voidsetIABCategory(java.lang.string mIABCategory) Sets IAB category for the application.
voidsetIncome(java.lang.string income) Set user Income if available for more relevant Ads.
voidsetLocation(android.location.Location mLocation) Set the location of the user.
protected voidPMAdRequest.OPERID operId) 
voidsetOrmmaComplianceLevel(int mOrmmaComplianceLevel) Minimum compliance level.
voidsetPMZoneId(java.lang.string mPMZoneId) This parameter is used to pass a zone ID for reporting.
protected voidsetPubId(java.lang.string publisherId) You have to set the Publisher id before making a call to loadAd.
protected voidsetSiteId(java.lang.string siteId) You have to set the site id before making call to loadAd.
voidsetState(java.lang.string state) State of the user.
voidsetStoreURL(java.lang.string mStoreURL) URL of the app store from where a user can download this application.
voidPMAdRequest.HASHING_TECHNIQUE hashing) Set type of algorithm used for hashing the device identifier provided in the udid parameter mentioned above.
protected voidsetUpPostParams() 
protected voidsetUpUrlParams() 
voidsetYearOfBirth(java.lang.string yearOfBirth) Set user's birth year as a four-digit integer.
voidsetZip(java.lang.string zip) Set home zip code if the user is present in the U.S.; otherwise it indicates the postal code

 

Methods inherited from class com.pubmatic.sdk.common.AdRequest


addUrlParam, getChannel, getCustomParams, getPostData, getUrlParams, initializeDefaultParams, putPostData, setAdSize, setAndroidAidEnabled, setContext, setCustomParams, setUrlParams, setUserAgent

 

Methods inherited from class java.lang.Object


clone, equals, finalize, getClass, hashCode, notify, notifyAll, tostring, wait, wait, wait

 

Field Detail


mOrmmaComplianceLevel

protected int mOrmmaComplianceLevel

 

mPaid

protected java.lang.Boolean mPaid

 

mCoppa

protected java.lang.Boolean mCoppa

 

mPubId

protected java.lang.string mPubId

 

mSiteId

protected java.lang.string mSiteId

 

mAdId

protected java.lang.string mAdId

 

mIABCategory

protected java.lang.string mIABCategory

 

mPMZoneId

protected java.lang.string mPMZoneId

 

mStoreURL

protected java.lang.string mStoreURL

 

mAid

protected java.lang.string mAid

 

mAppCategory

protected java.lang.string mAppCategory

 

mAppDomain

protected java.lang.string mAppDomain

 

mAdOrientation

protected java.lang.string mAdOrientation

 

mCity

protected java.lang.string mCity

 

mZip

protected java.lang.string mZip

 

mDMA

protected java.lang.string mDMA

 

mAdType

protected PMAdRequest.AD_TYPE mAdType

 

mAWT

protected PMAdRequest.AWT_OPTION mAWT

 

mOperId

protected PMAdRequest.OPERID mOperId

 

mEthnicity

protected PMAdRequest.ETHNICITY mEthnicity

 

mGender

protected PMAdRequest.GENDER mGender

 

mHashing

protected PMAdRequest.HASHING_TECHNIQUE mHashing

 

mState

protected java.lang.string mState

 

mYearOfBirth

protected java.lang.string mYearOfBirth

 

mIncome

protected java.lang.string mIncome

 

mKeywordsList

protected java.util.ArrayList<java.lang.string> mKeywordsList

 

Constructor Detail


PMAdRequest

protected PMAdRequest()

 

Method Detail


setUpUrlParams

protected void setUpUrlParams()

 

 

Overrides:
setUpUrlParams in class AdRequest

 

setUpPostParams

protected void setUpPostParams()

 

getAdType

protected PMAdRequest.AD_TYPE getAdType()

 

setAdType

protected void setAdType(PMAdRequest.AD_TYPE mAdType)

 

getAWT

protected PMAdRequest.AWT_OPTION getAWT()

 

setAWT

protected void setAWT(PMAdRequest.AWT_OPTION mAWT)

 

setAdId

protected void setAdId(java.lang.string adTagId)

 

AdTagId is associated with the Banner Ad Size. You have to create the AdTagId for recommended size. Before loading the Ad's you have to set the respective AdTagId for given Banner.

 

Parameters:
adTagId - adTagId to set

 

setSiteId

protected void setSiteId(java.lang.string siteId)

 

You have to set the site id before making call to loadAd.

 

Parameters:
siteId - siteId to set

 

setPubId

protected void setPubId(java.lang.string publisherId)

 

You have to set the Publisher id before making a call to loadAd.

 

Parameters:
publisherId - publisherId The publisher id provided by PubMatic.

 

getOperId

protected PMAdRequest.OPERID getOperId()

 

setOperId

protected void setOperId(PMAdRequest.OPERID operId)

 

getDMA

protected java.lang.string getDMA()

 

getUdidHash

public PMAdRequest.HASHING_TECHNIQUE getUdidHash()

 

setUdidHash

public void setUdidHash(PMAdRequest.HASHING_TECHNIQUE hashing)

 

Set type of algorithm used for hashing the device identifier provided in the udid parameter mentioned above. Possible values are: Unknown Raw SHA1 MD5 Note: This parameter is mandatory for only Mobile Applications

 

Parameters:
hashing - type

 

getAdServerURL

public java.lang.string getAdServerURL()

 

Description copied from class: AdRequest

Returns the base/host name URL

 

Specified by:
getAdServerURL in class AdRequest

 

Returns:

 

checkMandatoryParams

public Boolean checkMandatoryParams()

 

 

Specified by:
checkMandatoryParams in class AdRequest

 

Returns:

 

setZip

public void setZip(java.lang.string zip)

 

Set home zip code if the user is present in the U.S.; otherwise it indicates the postal code

 

Parameters:
zip - zip of the user

 

getZip

public java.lang.string getZip()

 

setDMA

public void setDMA(java.lang.string mDMA)

 

Designated market area (DMA) code of the user. This field is applicable for US users only. For example, dma=734

 

Parameters:
mDMA -

 

getCity

public java.lang.string getCity()

 

 

Returns:
Returns city parameter

 

setCity

public void setCity(java.lang.string city)

 

Sets city of the user.

 

Parameters:
city - User's city

 

getGender

public PMAdRequest.GENDER getGender()

 

setGender

public void setGender(PMAdRequest.GENDER gender)

 

Set Gender of the user to deliver more relevant ads. Possible values are: Male Female Others

 

Parameters:
gender -

 

getState

public java.lang.string getState()

 

 

Returns:

 

setState

public void setState(java.lang.string state)

 

State of the user. For example, state=NY

 

Parameters:
state -

 

setYearOfBirth

public void setYearOfBirth(java.lang.string yearOfBirth)

 

Set user's birth year as a four-digit integer. For example, 1975

 

Parameters:
yearOfBirth - yearOfBirth of the user

 

setIncome

public void setIncome(java.lang.string income)

 

Set user Income if available for more relevant Ads. User's income or income range in dollars (whole numbers). For example, inc=50000 or 50000-75000

 

Parameters:
income - Sets the user income value

 

setEthnicity

public void setEthnicity(PMAdRequest.ETHNICITY ethnicity)

 

Numeric code of ethnicity. Possible options are: Hispanic African-American Caucasian Asian-American Other

 

Parameters:
ethnicity - User ethnicity

 

getEthnicity

public PMAdRequest.ETHNICITY getEthnicity()

 

addKeyword

public void addKeyword(java.lang.string keyword)

 

Add the new keyword that the user might be interested in.

 

Parameters:
keyword - the new keyword to be added to the keywords list

 

getYearOfBirth

public java.lang.string getYearOfBirth()

 

Returns the year of birth of the user.

 

Returns:
the yearOfBirth

 

getIncome

public java.lang.string getIncome()

 

Returns the income of the user.

 

Returns:
the income of user

 

getKeywordstring

public java.lang.string getKeywordstring()

 

Returns the keywords list in the form of comma separated string. e.g. Cricket,Pizza

 

getPubId

public java.lang.string getPubId()

 

Getter for ID of the publisher. This value can be obtained from the pubId parameter in the PubMatic ad tag.

 

Returns:

 

getSiteId

public java.lang.string getSiteId()

 

Getter for ID of the publisher's site/app. This value can be obtained from the siteId parameter in the PubMatic ad tag.

 

Returns:

 

getAdId

public java.lang.string getAdId()

 

Getter for ID of the publisher's ad tag ID. This value can be obtained from the adId parameter in the PubMatic ad tag.

 

Returns:

 

getIABCategory

public java.lang.string getIABCategory()

 

setIABCategory

public void setIABCategory(java.lang.string mIABCategory)

 

Sets IAB category for the application. If the site/application falls under multiple IAB categories, you can send categories separated by comma, and the string should be URL encoded. For example, iabcat=IAB1%2CIAB-5%2CIAB1-6

 

Parameters:
mIABCategory -

 

isCoppa

public java.lang.Boolean isCoppa()

 

setCoppa

public void setCoppa(Boolean mCoppa)

 

Indicates whether the visitor is COPPA-specific or not. For COPPA (Children's Online Privacy Protection Act) compliance, if the visitor's age is below 13, then such visitors should not be served targeted ads. Possible options are: false - Indicates that the visitor is not COPPA-specific and can be served targeted ads. true - Indicates that the visitor is COPPA-specific and should be served only COPPA-compliant ads.

 

Parameters:
mCoppa -

 

getPMZoneId

public java.lang.string getPMZoneId()

 

setPMZoneId

public void setPMZoneId(java.lang.string mPMZoneId)

 

This parameter is used to pass a zone ID for reporting.

 

Parameters:
mPMZoneId -

 

getStoreURL

public java.lang.string getStoreURL()

 

setStoreURL

public void setStoreURL(java.lang.string mStoreURL)

 

URL of the app store from where a user can download this application.

 

Parameters:
mStoreURL -

 

getAid

public java.lang.string getAid()

 

It is not in use.

 

setAid

public void setAid(java.lang.string mAid)

 

It is not in use. Android application’s ID

 

Parameters:
mAid -

 

getAppDomain

public java.lang.string getAppDomain()

 

setAppDomain

public void setAppDomain(java.lang.string appDomain)

 

Indicates the domain of the mobile application

 

Parameters:
appDomain - domain of app

 

getAppCategory

public java.lang.string getAppCategory()

 

setAppCategory

public void setAppCategory(java.lang.string mAppCategory)

 

Application primary category as displayed on storeurl page for the respective platform

 

Parameters:
mAppCategory -

 

isApplicationPaid

public java.lang.Boolean isApplicationPaid()

 

Indicates whether the mobile application is a paid version or not. Possible values are: false - Free version, true - Paid version

 

Returns:

 

setApplicationPaid

public void setApplicationPaid(Boolean paid)

 

Indicates whether the mobile application is a paid version or not. Possible values are: false - Free version true - Paid version

 

Parameters:
paid -

 

getOrmmaComplianceLevel

public int getOrmmaComplianceLevel()

 

setOrmmaComplianceLevel

public void setOrmmaComplianceLevel(int mOrmmaComplianceLevel)

 

Minimum compliance level. Possible values are 0, 1 and 2

 

Parameters:
mOrmmaComplianceLevel -

 

getAdOrientation

public java.lang.string getAdOrientation()

 

setAdOrientation

public void setAdOrientation(java.lang.string mAdOrientation)

 

Set the ad orientation. Possible values are: 0 - Portrait orientation 1 - Landscape orientation

 

Parameters:
mAdOrientation -

 

getDeviceOrientation

public int getDeviceOrientation(android.content.Context context)

 

getLocation

public android.location.Location getLocation()

 

Description copied from class: AdRequest

Return the location of the user.

 

Overrides:
getLocation in class AdRequest

 

Returns:
the user location

 

setLocation

public void setLocation(android.location.Location mLocation)

 

Description copied from class: AdRequest

Set the location of the user.

 

Overrides:
setLocation in class AdRequest

 

Parameters:
mLocation - Location of the user

 

Attachments

    Outcomes