Wiki
Clone wikiAATKit iOS / AATKit_Keyword_Targeting
Keyword Targeting
Index:
- Project Setup
- AATKit Initialisation
- Banner Integration
- Fullscreen Integration
- APP Open Integration
- Native Ads Integration
- Native Ads Integration - special ad network characteristics
- Promo Screen
- Sample
- Disable App Transport Security (ATS)
- Advanced Features
- Targeting
- Rewarded Video
- Frequency Capping
- Header documentation
- Important Remarks
- AATKit's Size within your app
- What is an AdSpace?
- Network-specific Information
- Statistics Delegate
- Reports Delegate
- Listen to impression level information
- AATKit AdMob custom events adapter (>= 2.77.x)
General Information
Some networks support adding additional information to improve the ads for the current app context.
Keywords can be defined as a dictionary like this: @{@"interests": @[@"sports", @"stocks"], @"gender": @"female"}
.
Important remark: If you are using the new request/response based banner API or the banner cache, then all targeting settings have to be configured for the used ad request object, as described here. The global or placement specific settings described below will not be applied there.
Supported types of the keys: NSString.
Supported types for the values: NSString, NSNumber, and NSArray containing NSString and/or NSNumber. Please contact the support team for help when defining targeting information.
In case you want to use keyword targeting, you have to insert them into the AATKit by calling one or both of the following methods:
Set global Keywords
#!objective-c + (void)setTargetingInfo:(nullable NSDictionary*)targetingInfo;
Example:
Objective-C:
#!objective-c [AATKit setTargetingInfo:@{@"interests": @[@"sports", @"stocks"], @"gender": @"female"}];
#!swift AATKit.setTargetingInfo(["interests": ["sports", "stocks"], "gender": "female"])
Set Placement specific Keywords
#!objective-c + (void) setTargetingInfo:(nonnull NSDictionary*)targetingInfo forPlacement:(nonnull NSObject<AATKitPlacement>*)placement;
Example:
Objective-C:
#!objective-c [AATKit setTargetingInfo:@{@"interests": @[@"sports", @"stocks"], @"gender": @"female"} forPlacement:yourPlacement];
#!swift AATKit.setTargetingInfo(["interests": ["sports", "stocks"], "gender": "female"], for: <YourPlacement>)
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:
#!objective-c + (void)addAdNetworkForKeywordTargeting:(enum AATKitAdNetwork)adNetwork;
Enables previously set keywords for a specific ad network only. When setting global and placement specific keywords, the latter will take precedence.
Currently, only a subset of ad networks available in the AATKit is supported:
- AdMob
- DFP
- MoPub
- Smaato
- SmartAdServer
Ad networks are specified using a value of the enumeration AATKitAdNetwork
.
Example:
Objective-C:
#!objective-c [AATKit addAdNetworkForKeywordTargeting:AATDFP];
#!swift AATKit.addAdNetwork(forKeywordTargeting: .AATDFP)
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.
#!objective-c + (void)removeAdNetworkForKeywordTargeting:(enum AATKitAdNetwork)adNetwork;
Example:
Objective-C:
#!objective-c [AATKit removeAdNetworkForKeywordTargeting:AATDFP];
#!swift AATKit.removeAdNetwork(forKeywordTargeting: .AATDFP)
Content Targeting URL
By now only ad requests for networks with the GADRequest
class support adding a content URL to the request.
So this affects ad requests for:
- AdMob
- AdX
- DFP
- Bluestack
(As mentioned at the top of this page, the new banner API and banner cache require a different approach to configure the 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.
#!objective-c + (void)setContentTargetingURL:(nullable NSString*)targetingURL;
Example:
Objective-C:
#!objective-c [AATKit setContentTargetingURL:@"http://www.addapptr.com"];
#!swift AATKit.setContentTargetingURL("http://www.addapptr.com")
Set the content targeting URL for a specific placement for all following ad request. General setting of the content targeting URL will be overwritten for this placement.
#!objective-c + (void)setContentTargetingURL:(nullable NSString*)targetingURL forPlacement:(nonnull NSObject<AATKitPlacement>*)placement;
Objective-C:
#!objective-c [AATKit setContentTargetingURL:@"http://www.addapptr.com" forPlacement:<YourPlacement>];
#!swift AATKit.setContentTargetingURL("http://www.addapptr.com", for: <YourPlacement>)
back (Advanced Features)
next (Frequency Capping)
Updated