firebase::
gma::
AdRequest
#include <types.h>
Contains targeting information used to fetch an ad.
Summary
Constructors and Destructors
~AdRequest
()
Public functions
add_extra
(const char *adapter_class_name, const char *extra_key, const char *extra_value)
void
add_keyword
(const char *keyword)
void
add_neighboring_content_urls
(const std::vector< std::string > & neighboring_content_urls)
void
content_url
() const
const std::string &
extras
() const
const std::map< std::string, std::map< std::string, std::string > > &
keywords
() const
const std::unordered_set< std::string > &
neighboring_content_urls
() const
const std::unordered_set< std::string > &
set_content_url
(const char *content_url)
void
Public functions
AdRequest
AdRequest ( const char * content_url )
Creates an AdRequest with the optional content URL.
When requesting an ad, apps may pass the URL of the content they are serving. This enables keyword targeting to match the ad with the content.
The URL is ignored if null or the number of characters exceeds 512.
content_url
add_extra
void add_extra ( const char * adapter_class_name , const char * extra_key , const char * extra_value )
Add a network extra for the associated ad mediation adapter.
Appends an extra to the corresponding list of extras for the ad mediation adapter. Each ad mediation adapter can have multiple extra strings.
adapter_class_name
|
the class name of the ad mediation adapter for which to add the extra.
|
extra_key
|
a key which will be passed to the corresponding ad mediation adapter.
|
extra_value
|
the value associated with extra_key.
|
add_keyword
void add_keyword ( const char * keyword )
Adds a keyword for targeting purposes.
Multiple keywords may be added via repeated invocations of this method.
keyword
add_neighboring_content_urls
void add_neighboring_content_urls ( const std :: vector < std :: string > & neighboring_content_urls )
Adds to the list of URLs which represent web content near an ad.
Promotes brand safety and allows displayed ads to have an app level rating (MA, T, PG, etc) that is more appropriate to neighboring content.
Subsequent invocations append to the existing list.
neighboring_content_urls
content_url
const std :: string & content_url () const
The content URL targeting information.
Details | |
---|---|
Returns |
extras
const std :: map < std :: string , std :: map < std :: string , std :: string > > & extras () const
A Map of adapter class names to their collection of extra parameters, as configured via add_extra .
keywords
const std :: unordered_set < std :: string > & keywords () const
Keywords which will help GMA to provide targeted ads, as added by add_keyword .
neighboring_content_urls
const std :: unordered_set < std :: string > & neighboring_content_urls () const
Returns the set of neighboring content URLs or an empty set if no URLs were set via add_neighboring_content_urls() .
set_content_url
void set_content_url ( const char * content_url )
When requesting an ad, apps may pass the URL of the content they are serving.
This enables keyword targeting to match the ad with the content.
The URL is ignored if null or the number of characters exceeds 512.
content_url
~AdRequest
~ AdRequest ()