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
- Flash
Broadsign enables HTML5
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
Automatic Variables
The following variables will always be automatically injected into all HTML5
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 |
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 Slave Frame.
Note: You are unable to override automatic variables.
Here are the different kinds of content variables used in Broadsign Control:
- Ad copy 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.
- 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.
Depending on how you preview an HTML5
- 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>
Note: To view player Flash variables or the automatic variable player_id, you need to schedule the Flash file and run it on an active player system.
The following ActionScript code will iterate through all the available Flash variables and print them out to the debug console. It is meant as an example only.
var myFlashvars:Object = new Object();
var vars:String = new String();
myFlashvars = this.loaderInfo.parameters;
for (var item:String in myFlashvars) {
trace(item + ":t" + myFlashvars[item]);
}