Enable Video Ad Targeting with a redirect tag (Web Player)
Increase video ad revenues by sending unique content performance and contextual signals to buyers through a redirect tag.
Video Ad Targeting is a JWP feature that increases video ad revenues by sending unique content performance and contextual signals to buyers. Implementing through a redirect tag allows you to take advantage of the benefits without setting up header bidding through Prebid.js or JWP's Player Bidding.
Requirement
Item | Notes |
---|---|
JWΒ PlayerΒ mediaΒ ID | Unique identifier for a JWP video API approach: 1. Make a GET https://api.jwplatform.com/v1/videos/list call. 2. In the API response, locate the videos[].key of the applicable video. Dashboard approach: From the video list page, copy the ID in the MEDIA ID column. If the MEDIA ID column is not exposed, click the gear icon above the list of videos. From the list that appears, select Media ID. |
Obtain JWP segments
-
Add the following jwvat.js script tag to your pages. This script creates a global
jwvat
object that exposes agetSegment
function.<script type="text/javascript" src="http://p.jwpcdn.com/boost/jwvat/v/1/jwvat.js"></script>
-
Add the following code to the
<body>
of your page. Be sure to replacejwplayer-media-id
with the media ID for a specific video.
ThegetSegments
function takes three arguments and enables you to fetch the segments of a specified media ID. The segments are returned as an array of strings,['seg1', 'seg2', 'seg3']
.var jwvat = jwvat || {}; jwvat.que = jwvat.que || []; jwvat.que.push(function() { jwvat.getSegments('jwplayer-media-id', (segments) => { // append the segments to your ad request }, (code, source) => { // error handling // code is an error identifier // source is the original error- can be undefined }); });
Argument Description jwplayer-media-id Unique identifier for a JWP video (success callback) Called with the resulting segments array if the request succeeds (error callback) Called with the following two parameters if the request fails: code
: Numeric error code, see Error callback parameterssourceError
: Root error which caused the failure, see Error callback parameters
Error callback parameters
Code Description Source Error 1 Unable to create a request because XMLHttpRequest
is absent from the context-- 2 Request error, most likely due to a networking issue Root error 3 Response status code was not 200
Object containing the HTTP status
code4 Request succeeded but the response did not contain segments -- 5 Response could not be parsed Parsing error
Add targeting information in Google Ad Manager (GAM)
To share JWP's targeting segments with your advertising supplier, you must create a VAST redirect creative with the URL provided to you by your JWP representative.
The following instructions are provided to simplify your implementation.
GAM is not a JWP product. Aspects of creating a VAST redirect creative within GAM may change. If a step in our instructions does not match your GAM dashboard, please refer to Google's Traffic a video or audio creative and Generate video and audio ad tags articles.
- In your GAM dashboard, click Delivery > Creatives > VAST creatives > New creative. The Select advertiser to add creative pop-up window appears.
- Select an advertiser.
- Click OK.
- On the VAST creative page, click Redirect.
- In Settings, enter the Name, Target ad unit size, and VAST tag URL. For the VAST tag URL, use the 3rd-party redirect tag provided by your JWP BOOST representative. Be sure that the 3rd-party redirect tag has
&jwpseg=%%PATTERN:jwpseg%%
and GAMβs GPDR macro appended to it. - Click SAVE.
- Use the following sections to add the Video Ad Targeting to either a Google Publisher Tag or to a Google VAST ad tag URL.
β β β
Using Google Publisher Tags (GPT)
The following steps are a continuation of the steps in Add targeting information in Google Ad Manager (GAM).
- Copy and paste the following code. The
.setTargeting
uses thejwpseg
values to set the Video Ad Targeting. Thesegments.join(',')
converts the segments into a concatenated, comma-delimited string. Thesegments
are returned fromjwvat.getSegments()
referenced in the Obtain JWP segments section.
<div id="your-div-id"> <script> googletag.cmd.push(function() { googletag.defineSlot('/your-network-code/your-ad-unit', [640, 480],'your-div-id') .addService(googletag.pubads()) .setTargeting("jwpseg", segments.join(',')); googletag.enableServices(); googletag.display('your-div-id'); }); </script> </div>
- Replace the
/your-network-code/your-ad-unit
placeholder with the Google ad unit. - Replace the
your-div-id
placeholder with the ID of the<div>
that contains the Google ad unit.
β β β
Using a Google VAST ad tag URL
The following steps are a continuation of the steps in Add targeting information using Google Ad Manager (GAM).
- Fill in the necessary information and click CONTINUE on the following pages.
- Copy the Video tag code a notepad.
- Add the following code to your page. The
&cust_params=' + encodeURIComponent('jwpseg=' + segments.join(','))
adds and converts the segments into a concatenated, comma-delimited string. Thesegments
are returned fromjwvat.getSegments()
referenced in the Obtain JWP segments section.
jwvat.que.push(function() { jwvat.getSegments('your_media_id', (segments) => { const adTagUrl = 'googleAdManagerVideoTag&cust_params=' + encodeURIComponent('jwpseg=' + segments.join(',')); jwplayer.loadAd(adTagUrl); }); });
- In the
adTagUrl
, replacegoogleAdManagerVideoTag
with the video tag you copied in step 2.
Add targeting information in another ad server
If you use another platform as your video ad serving platform, ask your video ad serving platform representative how to add macros to an ad tag. Typically, you can add a URL parameter similar to the following: &jwpseg=[jwpseg]
. Be sure to also add the platform-specific macro for GDPR.
Updated about 1 year ago