Content Variables
Content Variables
Broadsign Control Products can run content that pulls variables and customizes behaviours on-the-fly by using content variables.
Our content variables are available for the following content:
- web redirects
- HTML5
Broadsign enables HTML5 files to retrieve different variables based on the context in which they play.
Example: Suppose a network operator wants to offer a "branded news" product to its customers. In this product, the customer could display their own logo beside the news. With content variables, the operator would need only a single HTML5 file. Each display unit or player would have a unique content variable defining the URL of the customer's logo. When the customer's player displays the HTML5 file, it can read the logo's URL from the content variables. Then, the content displays correctly.
Automatic Variables
The following variables will always be automatically injected into all HTML5 files played by Broadsign Control Player:
Variable | Description |
display_unit_address | The address field of the display unit. See The General Section. |
display_unit_id | The ID# of the display unit to which you have assigned a player. See The General Section. |
display_unit_lat_long | The latitudinal and longitudinal values of the display unit's location. See The General Section. |
display_unit_location_code | The location code field of the display unit. See The General Section. |
display_unit_resolution | The current resolution of the display unit type (W×H). See Display Types. |
player_id | The ID of the player resource playing the ad copy. Edit Player Properties. |
frame_id | The ID of the frame in which the ad copy is playing. See Edit Frame Properties. |
frame_resolution | The current resolution of the frame in which the ad copy is playing (W×H). |
campaign_id | The ID of the campaign that is playing the HTML5 ad copy. |
impressions_per_hour | Taken from Column 14 of the uploaded audience data. The value is a fraction. See Impressions Formulas. |
expected_slot_duration_ms | The expected slot duration in milliseconds. Some content is of variable duration. As a result, there could be a difference between expected "dwell" and "prorated" duration. See Impressions Formulas. |
dwell_time_duration_ms | Represents the loop policy duration in milliseconds. See Impressions Formulas. |
expected_impressions | A prorated value. Calculated taking into account the sometimes-variable duration of slots. See Impressions Formulas. |
Note: The impressions_per_hour and expected_impressions variables are not calculated for synchronized Campaigns on a Follower Frame.
Note: You are unable to override automatic variables.
Here are the different kinds of content variables used in Broadsign Control:
- Ad copy variables
- Campaign variables
- Display unit variables
- Player variables
- Automatic variables (see Automatic Variables)
Identically-named variables adhere to the following precedence rules: player variables can override display unit variables, which in turn override ad copy variables. This allows defaults to cascade from the top down.
Note: You are unable to override automatic variables.
You can create your own variables in Broadsign Control Administrator. Three different types of resources can contain variables: ad copies, display units and players.
The process for adding any of these three types is basically the same. To illustrate, we will add an ad copy variable called bgcolor that could vary the image background, for example.
To add an ad copy variable:
- In Broadsign Control Administrator, select an HTML ad copy (see HTML Package Ad Copy).
- Open the Ad Copy Properties (see Edit Ad Copy Properties).
- Go to Settings > Variables.
- Select Add.
- Enter the variable information:
- Click OK, and then click Apply.
For more details about variables by resource type:
- Ad copy variables – In the Ad Copy Properties, go to Settings > Variables. See Variables Tab.
- Loop policy variables – In the Loop Policy Properties, go to Settings > Variables. See Variables Tab.
- Campaign variables – In the Campaign Properties, go to Settings > Variables. See The Settings Section.
- Display unit variables – In the Display Unit Properties, go to Settings > Variables. See Variables Tab.
- Player variables – In the Player Properties, go to Settings > Variables. See The Variables Tab.
You can batch edit existing variables in Broadsign Control Administrator. The batch editor is available in the following types of resources: ad copies, loop policies, display units, players, and campaigns. The batch editor can display all variables up to a total length of 64kb.
The process for batch editing any of these types is basically the same. To illustrate, we will access the batch editor in the ad copy properties.
To access the display unit variable batch editor:
- In Broadsign Control Administrator, select an HTML ad copy (see HTML Package Ad Copy).
- Open the Ad Copy Properties (see Edit Ad Copy Properties).
- Go to Settings > Variables.
- Select Batch Edit.
- Edit any of the variables information.
- Click Apply.
The Batch Editor interface is displayed.
Depending on how you preview an HTML5 file in Broadsign Control Administrator, you will see different content variables. This is due to the context in which they are invoked.
- Ad Copy Preview – Only content variables from the ad copy are injected. In the Ad Copy Properties, go to Preview. See The Preview Section.
- Display Unit Preview – Content variables from the ad copy and display unit are injected. Also, the following automatic variables are injected:
- display_unit_address
- display_unit_location_code
- display_unit_resolution
- frame_id
frame_resolution
In the Display Unit Properties, go to Preview. See The Preview Section.
Note: To view player content variables or the automatic variable player_id, you need to schedule the HTML file and run it on an active player system.
The following JavaScript code will add a table to an HTML page that lists available variables:
<script>
var table = document.createElement("TABLE");
table.border = "1";
document.body.appendChild(table);
var headerRow = document.createElement("TR");
table.appendChild(headerRow);
var headerVariable = document.createElement("TH");
headerVariable.innerHTML = "Variable";
headerRow.appendChild(headerVariable);
var headerValue = document.createElement("TH");
headerValue.innerHTML = "Value";
headerRow.appendChild(headerValue);
for (var propertyName in BroadSignObject) {
var row = document.createElement("TR");
table.appendChild(row);
var variable = document.createElement("TD");
variable.innerHTML = propertyName;
row.appendChild(variable);
var value = document.createElement("TD");
value.innerHTML = BroadSignObject[propertyName];
row.appendChild(value);
}
</script>