For every ad unit, the content surrounding the ad can be mapped individually using either setContentUrl()
or setNeighboringContentUrls()
. Note that each ad unit should use only one type of content mapping, not both.
To use content mapping:
- Install Google Mobile Ads SDK version:
- Android: 19.0.0 or later for AdMob and 19.5.0 for Ad Manager
- iOS: 7.67.0 or later
- Determine which type of content mapping to use for each of your ad units.
- Ensure that the URLs you will pass are public (accessible by crawler). Learn more about making your site fully crawlable for AdMob or Ad Manager. Remember that the URL doesn’t need to be available to your users.
How to map content completely and accurately
Ensure that each piece of content maps to a URL that captures what the user sees in the app. The URLs you pass should provide a complete and accurate picture of the content that surrounds the ad.
<img>
tag.Use the examples below to learn more about what we mean by complete and accurate.
Example 1 - Complete mapping (includes all the content around an ad)
Example 2 - Accurate mapping
Example use cases
For the best performance, it’s important to pass URLs that thoroughly describe the content users see around the ad. First consider the type of ad being served to best determine what URL or URLs you should pass for content mapping.
Note that the following use cases are examples to help you determine how to use content mapping.
Banner ads
Native ads
Interstitial ads
Rewarded ads
App open ads
URL requirements
Consider the following when selecting URLs to use in content mapping:
- URLs must consistently match the content the user sees in the app. Learn more about our policies on misrepresentative content.
- Don’t pass Personally Identifiable Information (PII) or any information that violates your privacy agreement with your users.
- You can remove any PII (examples: full names, email addresses, geolocation parameters) within the content URLs that you send Google. We require a complete and accurate mapping of app content, but anything considered PII can be removed or replaced with a unique identifier prior to sending content URLs to Google.
- URLs must be crawlable by Google.
- URLs must return HTML documents where images are embedded using an HTML
<img>
tag. - If viewing the content requires a login, follow the instructions for configuring crawler logins.
- URLs must return HTML documents where images are embedded using an HTML
- URLs must not be shortened (for example,
goo.gl/MyContent
) - URLs must be unique to the content the user sees in the app.
- Don’t pass one generic URL for your entire app.
- Don’t pass your app’s Play Store, App Store, or other app store URLs.
- Don't append unnecessary URL parameters or tracking ids.
- If you have a desktop website (such as
example.com
) and a separate mobile website (such asm.example.com
), choose the URL which leads to the most complete representation of your app content.