Class TargetingParams
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBidderToAccessControlList(String bidderName) This method obtains a bidder name allowed to receive global targeting (ext.prebid.data)static voidaddContextData(String key, String value) Deprecated.use addExtDatastatic voidaddContextKeyword(String keyword) Deprecated.use addExtKeywordstatic voidaddContextKeywords(Set<String> keywords) Deprecated.use addExtKeywordsstatic voidaddExtData(String key, String value) This method obtains the context data keyword & value context for global context targeting if the key already exists the value will be appended to the list.static voidaddExtKeyword(String keyword) This method obtains the context keyword for adunit context targeting Inserts the given element in the set if it is not already present.static voidaddExtKeywords(Set<String> keywords) This method obtains the context keyword set for adunit context targeting Adds the elements of the given set to the set.static voidaddUserData(String key, String value) This method obtains the user data keyword & value for global user targeting if the key already exists the value will be appended to the list.static voidaddUserKeyword(String keyword) This method obtains the user keyword for global user targeting Inserts the given element in the set if it is not already present.static voidaddUserKeywords(Set<String> keywords) This method obtains the user keyword set for global user targeting Adds the elements of the given set to the set.static voidThis method allows to remove all the bidder name setstatic voidDeprecated.use clearExtDatastatic voidDeprecated.use clearExtKeywordsstatic voidThis method allows to remove all context data set from global context targetingstatic voidThis method allows to remove all keywords from the set of adunit context targetingstatic voidClear the Stored ExternalUserId list from the SharedPreferencestatic voidThis method allows to remove all user data set from global user targetingstatic voidThis method allows to remove all keywords from the set of global user targetingstatic ExternalUserIdfetchStoredExternalUserId(String source) Returns the stored (in the SharedPreference) ExternalUserId instance for a given sourcestatic List<ExternalUserId>Returns the stored (in the SharedPreferences) External User Id liststatic StringGet the platform-specific identifier, should be bundle/package namestatic StringDeprecated.use getExtDataDictionaryDeprecated.use getExtKeywordsSetstatic BooleanGets the device access consent set by the publisher.
If custom Prebid subject and purpose consent set, gets device access from them.static StringGet the domain of your appstatic StringGets any given GDPR consent in that order.static TargetingParams.GENDERGet the current user's gender, if it's available.static Stringstatic StringOMID signalingstatic Stringstatic Stringstatic BooleangetPurposeConsent(int index) Gets any given purpose consent for set index in that order.static StringGets any given purpose consent for set index in that order.static StringGet the store url of your appstatic Integerstatic Stringstatic Extstatic Stringstatic Stringstatic intGet the year of birth for targetingstatic BooleanGets subject to COPPA.static BooleanGets any given subject to GDPR in that order.static voidremoveBidderFromAccessControlList(String bidderName) This method allows to remove specific bidder namestatic voidremoveContextData(String key) Deprecated.use removeExtDatastatic voidremoveContextKeyword(String keyword) Deprecated.use removeExtKeywordstatic voidremoveExtData(String key) This method allows to remove specific context data keyword & values set from global context targetingstatic voidremoveExtKeyword(String keyword) This method allows to remove specific context keyword from adunit context targetingstatic voidremoveStoredExternalUserId(String source) Removes the stored (in the SharedPreference) ExternalUserId instance for a given sourcestatic voidremoveUserData(String key) This method allows to remove specific user data keyword & value set from global user targetingstatic voidremoveUserKeyword(String keyword) This method allows to remove specific user keyword from global user targetingstatic voidsetBundleName(String bundleName) Set the platform-specific identifier for targeting purpose Should be bundle/package namestatic voidsetBuyerId(String buyerId) Sets buyerIdstatic voidSet the domain of your app for targeting purposestatic voidsetGDPRConsentString(String consent) Sets GDPR consent for Prebid.static voidsetGender(TargetingParams.GENDER gender) Set the user's gender.static voidsetGlobalOrtbConfig(String config) Sets global OpenRTB JSON string for merging with the original request.static voidsetOmidPartnerName(String omidPartnerName) static voidsetOmidPartnerVersion(String omidPartnerVersion) static voidsetPublisherName(String publisherName) Sets publisher namestatic voidsetPurposeConsents(String purposeConsents) Sets Prebid custom GDPR purpose consents (device access consent).static voidsetStoreUrl(String storeUrl) Set the store url of your appstatic voidsetSubjectToCOPPA(Boolean value) Sets subject to COPPA.static voidsetSubjectToGDPR(Boolean value) Sets subject to GDPR for Prebid.static voidsetUserAge(Integer age) static voidsetUserCustomData(String data) Optional feature to pass bidder data that was set in the exchange’s cookie.static voidsetUserExt(Ext ext) Sets user Extstatic voidSet the user identifier.static voidsetUserLatLng(Float latitude, Float longitude) Sets user latitude and longitudestatic voidsetYearOfBirth(int yob) Set the year of birth and user age for targetingstatic voidstoreExternalUserId(ExternalUserId externalUserId) Use this API for storing the externalUserId in the SharedPreference.static voidupdateContextData(String key, Set<String> value) Deprecated.use updateExtDatastatic voidupdateExtData(String key, Set<String> value) This method obtains the context data keyword & values set for global context targeting.static voidupdateUserData(String key, Set<String> value) This method obtains the user data keyword & values set for global user targeting the values if the key already exist will be replaced with the new set of values
-
Field Details
-
BIDDER_NAME_APP_NEXUS
- See Also:
-
BIDDER_NAME_RUBICON_PROJECT
- See Also:
-
-
Method Details
-
setUserAge
-
getUserAge
-
getYearOfBirth
public static int getYearOfBirth()Get the year of birth for targeting- Returns:
- yob
-
setYearOfBirth
Set the year of birth and user age for targeting- Parameters:
yob- yob of the user- Throws:
Exception
-
getGender
Get the current user's gender, if it's available. The default value is UNKNOWN.- Returns:
- The user's gender.
-
setGender
Set the user's gender. This should be set if the user's gender is known, as it can help make buying the ad space more attractive to advertisers. The default value is UNKNOWN.- Parameters:
gender- The user's gender.
-
setUserLatLng
Sets user latitude and longitude- Parameters:
latitude- User latitudelongitude- User longitude
-
getUserLatLng
-
addUserData
This method obtains the user data keyword & value for global user targeting if the key already exists the value will be appended to the list. No duplicates will be added -
updateUserData
This method obtains the user data keyword & values set for global user targeting the values if the key already exist will be replaced with the new set of values -
removeUserData
This method allows to remove specific user data keyword & value set from global user targeting -
clearUserData
public static void clearUserData()This method allows to remove all user data set from global user targeting -
getUserDataDictionary
-
addUserKeyword
This method obtains the user keyword for global user targeting Inserts the given element in the set if it is not already present. -
addUserKeywords
This method obtains the user keyword set for global user targeting Adds the elements of the given set to the set. -
removeUserKeyword
This method allows to remove specific user keyword from global user targeting -
clearUserKeywords
public static void clearUserKeywords()This method allows to remove all keywords from the set of global user targeting -
getUserKeywords
-
getUserKeywordsSet
-
setUserCustomData
Optional feature to pass bidder data that was set in the exchange’s cookie. The string must be in base85 cookie safe characters and be in any format. Proper JSON encoding must be used to include “escaped” quotation marks.- Parameters:
data- Custom data to be passed
-
getUserCustomData
-
setUserId
Set the user identifier.- Parameters:
userId- the new user identifier
-
getUserId
-
setBuyerId
Sets buyerId- Parameters:
buyerId- Buyer-specific ID for the user as mapped by the exchange for the buyer. At least one of buyeruid or id is recommended.
-
getBuyerId
-
storeExternalUserId
Use this API for storing the externalUserId in the SharedPreference. Prebid server provide them participating server-side bid adapters.- Parameters:
externalUserId- the externalUserId instance to be stored in the SharedPreference
-
fetchStoredExternalUserId
Returns the stored (in the SharedPreference) ExternalUserId instance for a given source -
fetchStoredExternalUserIds
Returns the stored (in the SharedPreferences) External User Id list -
removeStoredExternalUserId
Removes the stored (in the SharedPreference) ExternalUserId instance for a given source -
clearStoredExternalUserIds
public static void clearStoredExternalUserIds()Clear the Stored ExternalUserId list from the SharedPreference -
setPublisherName
Sets publisher name- Parameters:
publisherName- Publisher name
-
getPublisherName
-
setDomain
Set the domain of your app for targeting purpose- Parameters:
domain- domain of your app
-
getDomain
Get the domain of your app- Returns:
- domain of your app
-
setStoreUrl
Set the store url of your app- Parameters:
storeUrl- store url
-
getStoreUrl
Get the store url of your app- Returns:
- store url
-
getBundleName
Get the platform-specific identifier, should be bundle/package name -
setBundleName
Set the platform-specific identifier for targeting purpose Should be bundle/package name -
addContextData
Deprecated.use addExtDataThis method obtains the context data keyword & value context for global context targeting if the key already exists the value will be appended to the list. No duplicates will be added (app.ext.data) -
updateContextData
Deprecated.use updateExtDataThis method obtains the context data keyword & values set for global context targeting. the values if the key already exist will be replaced with the new set of values -
removeContextData
Deprecated.use removeExtDataThis method allows to remove specific context data keyword & values set from global context targeting -
clearContextData
Deprecated.use clearExtDataThis method allows to remove all context data set from global context targeting -
getContextDataDictionary
Deprecated.use getExtDataDictionary -
addContextKeyword
Deprecated.use addExtKeywordThis method obtains the context keyword for adunit context targeting Inserts the given element in the set if it is not already present. (imp[].ext.context.keywords) -
addContextKeywords
Deprecated.use addExtKeywordsThis method obtains the context keyword set for adunit context targeting Adds the elements of the given set to the set. -
removeContextKeyword
Deprecated.use removeExtKeywordThis method allows to remove specific context keyword from adunit context targeting -
clearContextKeywords
Deprecated.use clearExtKeywordsThis method allows to remove all keywords from the set of adunit context targeting -
getContextKeywordsSet
Deprecated.use getExtKeywordsSet -
addExtData
This method obtains the context data keyword & value context for global context targeting if the key already exists the value will be appended to the list. No duplicates will be added (app.ext.data) -
updateExtData
This method obtains the context data keyword & values set for global context targeting. the values if the key already exist will be replaced with the new set of values -
removeExtData
This method allows to remove specific context data keyword & values set from global context targeting -
clearExtData
public static void clearExtData()This method allows to remove all context data set from global context targeting -
getExtDataDictionary
-
addExtKeyword
This method obtains the context keyword for adunit context targeting Inserts the given element in the set if it is not already present. (imp[].ext.context.keywords) -
addExtKeywords
This method obtains the context keyword set for adunit context targeting Adds the elements of the given set to the set. -
removeExtKeyword
This method allows to remove specific context keyword from adunit context targeting -
clearExtKeywords
public static void clearExtKeywords()This method allows to remove all keywords from the set of adunit context targeting -
getExtKeywordsSet
-
addBidderToAccessControlList
This method obtains a bidder name allowed to receive global targeting (ext.prebid.data) -
removeBidderFromAccessControlList
This method allows to remove specific bidder name -
clearAccessControlList
public static void clearAccessControlList()This method allows to remove all the bidder name set -
getAccessControlList
-
getOmidPartnerName
OMID signaling -
setOmidPartnerName
-
getOmidPartnerVersion
-
setOmidPartnerVersion
-
setSubjectToCOPPA
Sets subject to COPPA. Null to set undefined.
Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
isSubjectToCOPPA
Gets subject to COPPA. Null is undefined.
Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
setSubjectToGDPR
Sets subject to GDPR for Prebid. It uses custom static field, not IAB.
Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
isSubjectToGDPR
Gets any given subject to GDPR in that order.
1) Prebid subject to GDPR custom value, if present.
2) IAB subject to GDPR TCF 2.0.
Otherwise, null.
Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
setGDPRConsentString
Sets GDPR consent for Prebid. It uses custom static field, not IAB.
Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
getGDPRConsentString
Gets any given GDPR consent in that order.
1) Prebid GDPR consent custom value, if present.
2) IAB GDPR consent TCF 2.0.
Otherwise, null.
Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
setPurposeConsents
Sets Prebid custom GDPR purpose consents (device access consent).
Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
getPurposeConsent
Gets any given purpose consent for set index in that order.
1) Prebid GDPR purpose consent custom value, if present.
2) IAB GDPR TCF 2.0 purpose consent.
Returns null if purpose consent isn't set or index is out of bounds.
Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
getPurposeConsents
Gets any given purpose consent for set index in that order.
1) Prebid GDPR purpose consent custom value, if present.
2) IAB GDPR TCF 2.0 purpose consent.
Otherwise, null.Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
getDeviceAccessConsent
Gets the device access consent set by the publisher.
If custom Prebid subject and purpose consent set, gets device access from them. Otherwise, from IAB standard.Must be called only after
PrebidMobile.initializeSdk(Context, SdkInitializationListener). -
getGlobalOrtbConfig
-
setGlobalOrtbConfig
Sets global OpenRTB JSON string for merging with the original request. Expected format:"{"new_field": "value"}".- Parameters:
config- JSON OpenRTB string.
-
setUserExt
Sets user Ext- Parameters:
ext- Placeholder for exchange-specific extensions to OpenRTB.
-
getUserExt
-