Content mapping

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 the contentURL property on GADRequest:

Swift

let request = GADRequest()
request.contentURL = "https://www.example.com"

Objective-C

GADRequest *request = [GADRequest 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 content represented by up to four URLs by using the neighboringContentURLStrings property on GADRequest:

Swift

let request = GADRequest()
request.neighboringContentURLStrings =
    ["https://www.example1.com", "https://www.example2.com",
    "https://www.example3.com", "https://www.example4.com"]

Objective-C

GADRequest *request = [GADRequest request];
request.neighboringContentURLStrings =
    @[@"https://www.example1.com", @"https://www.example2.com",
    @"https://www.example3.com", @"https://www.example4.com"];