Android Ad Tag Targeting Macro Reference (Android)
Use macros to target ad tags.
Ad tag macros are supported in the Android SDK. Many VAST servers use tag variables to optimize fill and provide more information on how ads are being viewed. JWP supports a number of variables that can be added to your VAST tag URL. Once an ad call is made by JWP, the variables will be replaced accordingly.
JWP supports additional ad tag targeting macros for the HTML5 web player and OTT Apps.
VAST
General
Macro | Description |
---|---|
__domain__ | Domain name on which the player is embedded |
__page-url__ | File path of the video |
__player-height__ | Height of the video player Default: 100% |
__player-width__ | Width of the video player Default: 100% |
__random-number__ | Cache-buster to prevent caching of the VAST response |
__timestamp__ | Current time of the user's device |
Content
Macro | Description |
---|---|
__item-description__ | Short description of the currently playing video1 |
__item-duration__ | (Mid-roll, post-roll ads) Duration in seconds of the currently playing video1 |
__item-file__ | File URL of the currently playing video |
__item-mediaid__ | Custom media ID of the currently playing video1 |
__item-title__ | Title of the currently playing video1 |
1 Must be specified inside the playlist
// Set the ad break offset, note the ad tag variables in our ad tag URL
AdBreak adBreak = new AdBreak.Builder()
.offset("pre")
.tag("https://playertest.longtailvideo.com/adtags/vmap2.xml?descr=__item-description__&height=__player-height__&width=__player-width__")
.build();
List<AdBreak> adSchedule = new ArrayList<AdBreak>();
adSchedule.add(adBreak);
// Create video
PlaylistItem video = new PlaylistItem.Builder()
.file("http://playertest.longtailvideo.com/adaptive/bipbop/gear4/prog_index.m3u8")
.description("BipBop")
.adSchedule(adSchedule)
.build();
// Create a playlist
List<PlaylistItem> playlist = new ArrayList<PlaylistItem>();
playlist.add(video);
// Create your advertising config
VastAdvertisingConfig advertisingConfig = new VastAdvertisingConfig.Builder().build();
// Create your player config
PlayerConfig playerConfig = new PlayerConfig.Builder()
.playlist(playlist)
.advertisingConfig(advertisingConfig)
.build();
// Setup your player with the config
player.setup(playerConfig);
Google IMA
For Google IMA, the following ad targeting macros are supported:
- All ad targeting macros listed in the previous VAST section
- All ad tag variables supported by Google Ad Manager (GAM)
- Targeting variables added by the Google IMA SDK
As shown in the following example, users of GAM will however need to make minor alterations from the VAST examples above such as changing Google's description_url macro to description_url=__page-url__
.
https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/88234159/video&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&description_url=__page-url__&correlator=__timestamp__
See the IMA SDK Documentation for more information.
Updated 12 months ago