Set an ad tag via a key-value pair
Trigger ad tag updates based on real-time viewer and page data
Once you’ve deployed your Dynamic Strategy Rules placements, how can you ensure each viewer sees the most relevant video ad?
Dynamic Strategy Rules let you use key-value pairs to set up the player with a dynamic ad tag or change the ad tag during a user session. By leveraging page context, first-party data, or a customer-managed Prebid auction, you can dynamically generate the most relevant ad tag when the page renders.
Prerequisites
Item | Description |
---|---|
Placement ID | Unique identifier for the placement
Follow these steps to obtain the placement ID:
|
Ad Tag URL | URL of the ad to dynamically set |
Set the ad tag
Ad tag used at player setup
Follow these steps to dynamically insert an ad tag:
-
On a site page, set a key-value pair in the jwDataStore with the ad tag.
This client-side code must occur before the placement embed script loads the player.
const jwDataStore = window.jwDataStore || { custom: {} }; jwDataStore.custom.abcd1234 = { myPlacementLevelAd: "https://my.ad.com/placement-level-engaging-ad.xml" }; window.jwDataStore = jwDataStore;
Key-value pair Description <key> Unique name for the ad tag
Example:myPlacementLevelAd
<value> URL of the ad tag
Example:https://my.ad.com/placement-level-engaging-ad.xml
-
In your JWP dashboard, create an advertising experience for manual ad breaks or a VMAP:
- Enter a default Ad Tag URL. This ad tag will be used when an opportunity occurs on a page that does not have the specified key defined.
This ad tag will be used if the key set in step 2iii is missing from the
DataStore
.Based on the example in step 1, if myPlacementLevelAd is not in your
DataStore
, the ad tag in this field will be served. - Click Use Key for Ad Tag if available. A text field appears.
- Enter the on-page key defined for the ad tag to display to the viewer. Using the example in step 1, enter myPlacementLevelAd.
- Enter a default Ad Tag URL. This ad tag will be used when an opportunity occurs on a page that does not have the specified key defined.
Ad tag changes across the user session
Follow these steps to dynamically insert an ad tag:
-
On a site page, set a key-value pair in the jwDataStore with the ad tag.
This client-side code must occur before the trigger event occurs.
const jwDataStore = window.jwDataStore || { custom: {} }; jwDataStore.custom.abcd1234 = { myPlacementLevelAd: "https://my.ad.com/placement-level-engaging-ad.xml" }; window.jwDataStore = jwDataStore;
Key-value pair Description <key> Unique name for the ad tag
Example:myPlacementLevelAd
<value> URL of the ad tag
Example:https://my.ad.com/placement-level-engaging-ad.xml
-
In your JWP dashboard, create a trigger:
- For Trigger Type, select Advertising Event.
- For Trigger Event, select Before Play.
- For Event Trigger Frequency, select Every time.
-
Define the event trigger condition:
- From the first dropdown menu, select Player State.
- From the next dropdown menu, select Is.
- From the last dropdown menu, select Idle.
-
Define the trigger action:
- For Action Type, select Advertising.
- For Action, select Change ad breaks. The Configure Ad Breaks section appears.
- Select Change ad breaks manually or VMAP.
Item Selection Action Type Advertising Action Change ad breaks Configure ad breaks Idle
- Select Advertising.
- Select Change ad breaks.
- For the Ad Tag URL, enter a default ad tag URL.
This ad tag will be used if the key set in step 4viii is missing from the
DataStore
.Based on the example in step 1, if myPlacementLevelAd is not in your
DataStore
, the ad tag in this field will be served. - Click Use Key for Ad Tag if available. A text field appears.
- Enter the on-page key defined for the ad tag to display to the viewer. Using the example in step 1, enter myPlacementLevelAd.
Updated 9 days ago