Provide custom data to a placement

Learn how to add custom data to a placement

Custom data can be added for a specific placement. These parameters apply to a specific placement, such as a placement-level behavior.



Prerequisite

Item Description
Placement ID Unique identifier for the placement

Follow these steps to obtain the placement ID:
  1. On the Dynamic Strategy Rules page, on the Placements tab, click the name of the placement. The placement details page appears.
  2. In the row of the placement, copy the ID under the Placement ID column.


Add custom data

There are several approaches to add custom data for a placement: query parameters, HTML attributes, and jwDataStore. The following sections explain how to use each approach.


Query Parameters

Custom data is added through a query string appended to the embed URL.

Topic Details
ParsingOnly at page load
Supported Data TypesStrings
Requirements
  • Placement-level custom parameters are prefixed with custom.{placement-id}, such as custom.abcd1234 in the example below.
  • Custom parameters must be lowercase.
Data Override RulesOverridden by:
  • HTML Attributes
  • jwDataStore
Example
&custom.abcd1234.view_type=advert



HTML Attributes

⚠️

This approach is required for the header method.


Custom data is added through data attributes added to a JW placement <div> element.

Topic Details
ParsingOnly at page load
Supported Data TypesStrings
Requirements
  • The JW placement has data-jw-placement-id defined.
  • Placement-level custom parameters are prefixed with data-jw-
  • Custom parameters must be lowercase.
Data Override RulesOverrides:
  • Query Parameters
Overridden by:
  • jwDataStore
Example
<div 
    id="jwp-placement-1"
    data-jw-placement-id="plac1234"
    data-jw-media_id_1="medi1234"
    data-jw-playlist_id_1="play1234">
</div>



jwDataStore

Custom data is added through attributes added at the page level.

Topic Details
ParsingAt every rule evaluation
Supported Data TypesAll types
Requirements
  • Placement-level custom parameters are stored in jwDataStore.custom.{placement-id}, such as jwDataStore.custom.abcd1234 in the example below.
  • Custom parameters must be lowercase.
Data Override RulesOverrides:
  • Query Parameters
  • HTML Attributes
Example
const jwDataStore = window.jwDataStore || { custom: {} };
jwDataStore.custom.abcd1234 = { view_type: "advert" };
window.jwDataStore = jwDataStore;


© 2007-2024 Longtail Ad Solutions, Inc.