Page tree


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 (for example, PMBannerAdRequest, PMNativeAdRequest, and so on).

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.string mAdId  
protected java.lang.string mAdOrientation  
protected PMAdRequest.AD_TYPE mAdType  
protected java.lang.string mAid  
protected java.lang.string mAppCategory  
protected java.lang.string mAppDomain  
protected PMAdRequest.AWT_OPTION mAWT  
protected java.lang.string mCity  
protected java.lang.Boolean mCoppa  
protected java.lang.string mDMA  
protected PMAdRequest.ETHNICITY mEthnicity  
protected PMAdRequest.GENDER mGender  
protected PMAdRequest.HASHING_TECHNIQUE mHashing  
protected java.lang.string mIABCategory  
protected java.lang.string mIncome  
protected java.util.ArrayList<java.lang.string> mKeywordsList  
protected PMAdRequest.OPERID mOperId  
protected int mOrmmaComplianceLevel  
protected java.lang.Boolean mPaid  
protected java.lang.string mPMZoneId  
protected java.lang.string mPubId  
protected java.lang.string mSiteId  
protected java.lang.string mState  
protected java.lang.string mStoreURL  
protected java.lang.string mYearOfBirth  
protected java.lang.string mZip  

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


isAndroidAidEnabledmChannelmContextmCustomParamsmLocationmPMAdSizemPostDatamRRFormattermUrlParamsmUserAgent

Constructor Summary

ModifierConstructor and Description
protected PMAdRequest() 

Method Summary

Modifier and TypeMethod and Description
void addKeyword(java.lang.string keyword) Add the new keyword that the user might be interested in.
Boolean checkMandatoryParams() 
java.lang.string getAdId() Getter for ID of the publisher's ad tag ID.
java.lang.string getAdOrientation() 
java.lang.string getAdServerURL() Returns the base/host name URL
protected PMAdRequest.AD_TYPE getAdType() 
java.lang.string getAid() It is not in use.
java.lang.string getAppCategory() 
java.lang.string getAppDomain() 
protected PMAdRequest.AWT_OPTION getAWT() 
java.lang.string getCity() 
int getDeviceOrientation(android.content.Context context) 
protected java.lang.string getDMA() 
PMAdRequest.ETHNICITY getEthnicity() 
PMAdRequest.GENDER getGender() 
java.lang.string getIABCategory() 
java.lang.string getIncome() Returns the income of the user.
java.lang.string getKeywordstring() Returns the keywords list in the form of comma separated string.
android.location.Location getLocation() Return the location of the user.
protected PMAdRequest.OPERID getOperId() 
int getOrmmaComplianceLevel() 
java.lang.string getPMZoneId() 
java.lang.string getPubId() Getter for ID of the publisher.
java.lang.string getSiteId() Getter for ID of the publisher's site/app.
java.lang.string getState() 
java.lang.string getStoreURL() 
PMAdRequest.HASHING_TECHNIQUE getUdidHash() 
java.lang.string getYearOfBirth() Returns the year of birth of the user.
java.lang.string getZip() 
java.lang.Boolean isApplicationPaid() Indicates whether the mobile application is a paid version or not.
java.lang.Boolean isCoppa() 
protected void setAdId(java.lang.string adTagId) AdTagId is associated with the Banner Ad Size.
void setAdOrientation(java.lang.string mAdOrientation) Set the ad orientation.
protected void PMAdRequest.AD_TYPE mAdType) 
void setAid(java.lang.string mAid) It is not in use.
void setAppCategory(java.lang.string mAppCategory) Application primary category as displayed on storeurl page for the respective platform
void setAppDomain(java.lang.string appDomain) Indicates the domain of the mobile application
void setApplicationPaid(Boolean paid) Indicates whether the mobile application is a paid version or not.
protected void PMAdRequest.AWT_OPTION mAWT) 
void setCity(java.lang.string city) Sets city of the user.
void setCoppa(Boolean mCoppa) Indicates whether the visitor is COPPA-specific or not.
void setDMA(java.lang.string mDMA) Designated market area (DMA) code of the user.
void PMAdRequest.ETHNICITY ethnicity) Numeric code of ethnicity.
void PMAdRequest.GENDER gender) Set Gender of the user to deliver more relevant ads.
void setIABCategory(java.lang.string mIABCategory) Sets IAB category for the application.
void setIncome(java.lang.string income) Set user Income if available for more relevant Ads.
void setLocation(android.location.Location mLocation) Set the location of the user.
protected void PMAdRequest.OPERID operId) 
void setOrmmaComplianceLevel(int mOrmmaComplianceLevel) Minimum compliance level.
void setPMZoneId(java.lang.string mPMZoneId) This parameter is used to pass a zone ID for reporting.
protected void setPubId(java.lang.string publisherId) You have to set the Publisher id before making a call to loadAd.
protected void setSiteId(java.lang.string siteId) You have to set the site id before making call to loadAd.
void setState(java.lang.string state) State of the user.
void setStoreURL(java.lang.string mStoreURL) URL of the app store from where a user can download this application.
void PMAdRequest.HASHING_TECHNIQUE hashing) Set type of algorithm used for hashing the device identifier provided in the udid parameter mentioned above.
protected void setUpPostParams() 
protected void setUpUrlParams() 
void setYearOfBirth(java.lang.string yearOfBirth) Set user's birth year as a four-digit integer.
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

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


addUrlParamgetChannelgetCustomParamsgetPostDatagetUrlParamsinitializeDefaultParamsputPostDatasetAdSizesetAndroidAidEnabledsetContextsetCustomParamssetUrlParamssetUserAgent

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 - 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 only for mobile apps.

Parameters:

hashing - type.

getAdServerURL

public java.lang.string getAdServerURL()

Description copied from class:  AdRequest

Specified by:

getAdServerURL in class AdRequest

Returns:

Base/host name URL

checkMandatoryParams

public Boolean checkMandatoryParams()

Specified by:

checkMandatoryParams in class AdRequest

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:

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.

Parameters:

gender - Male, Female, or Others

getState

public java.lang.string getState()

setState

public void setState(java.lang.string state)

Parameters:

state - State of the user; for example, state=NY

setYearOfBirth

public void setYearOfBirth(java.lang.string yearOfBirth)

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

Parameters:

yearOfBirth - Birth year 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; for example, 1.

Parameters:

ethnicity - Possible options are:

      • 0 - Hispanic

      • 1 - African-American

      • 2 - Caucasian

      • 3 - Asian-American

      • 4 課メOther

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()

Getter for user's year of birth.

Returns:

yearOfBirth

getIncome

public java.lang.string getIncome()

Returns:

Income of the user

getKeywordstring

public java.lang.string getKeywordstring()

Returns:

Keywords list in the form of comma separated string; for example, Cricket,Pizza

getPubId

public java.lang.string getPubId()

Getter for ID of the publisher. You'll also find this value from the pubId parameter in the PubMatic ad tag.

Returns:

Publisher's ID

getSiteId

public java.lang.string getSiteId()

Getter for ID of the publisher's site/app. You'll also find this value in the siteId parameter in the PubMatic ad tag.

Returns:

Publisher's site/app ID

getAdId

public java.lang.string getAdId()

Getter for ID of the publisher's ad tag ID. You'll also find this value from the adId parameter in the PubMatic ad tag.

Returns:

Publisher's ad tag ID

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 a comma-separated list of categories. 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.

Parameters:

mCoppa - Values 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.

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()

Currently not in use.

setAid

public void setAid(java.lang.string mAid)

Android app’s ID—currently not in use.

Parameters:

mAid

getAppDomain

public java.lang.string getAppDomain()

setAppDomain

public void setAppDomain(java.lang.string appDomain)

Indicates the domain of the mobile app.

Parameters:

appDomain - domain of app

getAppCategory

public java.lang.string getAppCategory()

setAppCategory

public void setAppCategory(java.lang.string mAppCategory)

App's primary category displayed on mobile platform's storeurl page.

Parameters:

mAppCategory

isApplicationPaid

public java.lang.Boolean isApplicationPaid()

Indicates whether the mobile application is a paid version or not.

Returns:

false = Free version

true = Paid version

setApplicationPaid

public void setApplicationPaid(Boolean paid)

Indicates whether the mobile application is a paid version or not.

Parameters:

false = Free version, true - Paid version

getOrmmaComplianceLevel

public int getOrmmaComplianceLevel()

setOrmmaComplianceLevel

public void setOrmmaComplianceLevel(int mOrmmaComplianceLevel)

Minimum compliance level.

Parameters:

mOrmmaComplianceLevel - One of three values: 0, 1, or 2

getAdOrientation

public java.lang.string getAdOrientation()

setAdOrientation

public void setAdOrientation(java.lang.string mAdOrientation)

Sets the ad orientation. 

Parameters:

mAdOrientation - 0 = Portrait orientation, 1 = Landscape orientation

getDeviceOrientation

public int getDeviceOrientation(android.content.Context context)

getLocation

public android.location.Location getLocation()

Description copied from class:  AdRequest

Returns the location of the user.

Overrides:

getLocation in class AdRequest

Returns:

User's location

setLocation

public void setLocation(android.location.Location mLocation)

Description copied from class:  AdRequest

Sets the location of the user.

Overrides:

setLocation in class AdRequest

Parameters:

mLocation - User's location


⇧ Top