Targeting

Provide targeting information to ad requests

General Information

Some networks support adding additional information to improve the ads for the current app context. Keywords can be defined like this:

["interests": ["sports", "stocks"], "gender": ["female"]]

If you are using the infeed banner placement or the banner cache, then all targeting settings have to be configured for the used ad request object. The global or placement-specific settings described below will not be applied there.

Supported types of the keys: String.

Supported types for the values: String. Please contact the support team for help when defining targeting information.

Setting the keyword targeting must be done after initializing AATKit.

Set Global Targeting Keywords

To set the keyword targeting globally for all placements, you have to pass them to AATKit by calling the following method:

static func setTargetingInfo(info: [String: [String]])

Usage

AATSDK.setTargetingInfo(info: ["interests": ["sports", "stocks"], "gender": ["female"]])

Set Placement specific Keywords

Enables usage of keywords for specific placement in your application. The general setting of the targeting info will be overwritten for this placement.

Usage

placement.targetingInfo = ["interests": ["sports", "stocks"], "gender": ["female"]]

The specified keywords are used for all networks by default. If you want to restrict keyword usage to only specific networks, you need to continue reading.

Limit Ad Network specific Keywords

If you want to restrict keyword usage to specific ad networks, you have to use the following methods:

static func addAdNetworkForKeywordTargeting(network: AATAdNetwork)

Enables previously set keywords for a specific ad network only. When setting global and placement-specific keywords, the latter will take precedence.

Ad networks are specified using a value of the enumeration AATAdNetwork.

Usage

AATSDK.addAdNetworkForKeywordTargeting(network: .ADMOB)

You can also remove ad networks that were targeted before. The collection of ad network enumeration is a white list only. This means you cannot add networks to be excluded from keyword targeting.

static func removeAdNetworkForKeywordTargeting(network: AATAdNetwork)

Usage

AATSDK.removeAdNetworkForKeywordTargeting(network: .ADMOB)

Set Global Content Targeting URL

Set the content targeting URL for all following ad requests, unless you have set a content targeting URL for a specific placement before.

static func setContentTargetingUrl(targetingUrl: String)

Setting the content targeting URL must be done after initializing AATKit.

Usage

AATSDK.setContentTargetingUrl(targetingUrl: "http://www.gravite.com")

Set Placement Specific Content Targeting URL

Set the content targeting URL for a specific placement for all following ad requests. The general setting of the content targeting URL will be overwritten for this placement.

Usage

placement.contentTargetingUrl = "http://www.gravite.com"

Passing Multiple Values

In addition to a single content-targeting URL, AATKit supports passing a multi-content URL. Please note that if a multi-content URL is used, the single content targeting URL will no longer be passed.

placement.multiContentTargetingUrls = ["URL1", "URL2"]

Last updated