AI-generated Key Takeaways
-
Requires Google Mobile Ads SDK 7.67.0 or higher.
-
Content URLs can be passed for contextual targeting and brand safety.
-
You can pass a single content URL using
contentUrl. -
Up to four content URLs can be passed using
neighboringContentURLStrings.
Prerequisites
- Google Mobile Ads SDK 7.67.0 or higher
Content URL
Publishers who use content mapping to better monetize their app can pass a content URL for contextual targeting as well as brand safety.
For example, if you'd like to request ads next to content represented by
https://www.example.com, you can pass the URL using
contentUrl:
Swift
let request = GAMRequest()
request.contentURL = "https://www.example.com"
Objective-C
GAMRequest *request = [GAMRequest request];
request.contentURL = @"https://www.example.com";
Multi-content URL
If your content is represented by more than one URL, for example a feed app, you
can request ads next to the content with up to four URLs by using
neighboringContentURLStrings:
Swift
let request = GAMRequest()
request.neighboringContentURLStrings =
["https://www.example1.com", "https://www.example2.com",
"https://www.example3.com", "https://www.example4.com"]
Objective-C
GAMRequest *request = [GAMRequest request];
request.neighboringContentURLStrings =
@[@"https://www.example1.com", @"https://www.example2.com",
@"https://www.example3.com", @"https://www.example4.com"];