Content mapping
Stay organized with collections
Save and categorize content based on your preferences.
Prerequisites
- Google Mobile Ads SDK 19.0.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
AdRequest.Builder.setContentUrl()
:
Kotlin
val requestWithContent = AdRequest.Builder()
.setContentUrl("https://www.example.com")
.build()
Java
AdRequest requestWithContent = new AdRequest.Builder()
.setContentUrl("https://www.example.com")
.build();
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
AdRequest.Builder.setNeighboringContentUrls()
:
Kotlin
var urls = mutableListOf("https://www.example1.com", "https://www.example2.com",
"https://www.example3.com", "https://www.example4.com")
val requestWithContent = AdRequest.Builder()
.setNeighboringContentUrls(urls)
.build()
Java
ArrayList<String> urls = new ArrayList<String>();
urls.add("https://www.example1.com");
urls.add("https://www.example2.com");
urls.add("https://www.example3.com");
urls.add("https://www.example4.com");
AdRequest requestWithContent = new AdRequest.Builder()
.setNeighboringContentUrls(urls)
.build();
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-23 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-23 UTC."],[[["Publishers can use content URLs for contextual targeting and brand safety in their apps."],["`setContentUrl()` is used to pass a single content URL for ad requests."],["`setNeighboringContentUrls()` can pass up to four URLs for scenarios like feed apps with multiple content sources."],["You must use Google Mobile Ads SDK 19.0.0 or higher."]]],["Publishers using content mapping can enhance app monetization by passing content URLs for contextual targeting and brand safety. A single content URL, like `https://www.example.com`, can be passed via `AdRequest.Builder.setContentUrl()`. For multiple URLs, such as in feed apps, up to four URLs can be used with `AdRequest.Builder.setNeighboringContentUrls()`. This is available when using Google Mobile Ads SDK 19.0.0 or higher.\n"]]