Line Item Variables

For any case in which you may need multiple click trackers on a single creative, you’ll need to add what’s called ‘Line-item Variables’. These variables allow buttons from your creative to access multiple URL’s defined on your line-item order. For this, you’ll need to add some JavaScript along with our current set of Jetpack Actions.

First, set up some click through buttons on the stage.

1280

Next, set up an action on each button to have a trigger to click, and the event of a Global handler to have an Action of Custom JS.

825

Add the code sample below, but replace PUTLABELHERE with your own label for this button.

$jp.openLink("clickedPUTLABELHEREClickthrough", $jp.clickthroughUrlArray[0]);

Do the same with any additional buttons, but make sure they have unique labels. Also, make sure the array is sequential, and the number in [0] raises 1 value for each additional button. Like below:

$jp.openLink("clickedPUTLABELHEREClickthrough", $jp.clickthroughUrlArray[1]);

When each button is set, open the JavaScript Editor found under the View menu item.

202

Once the editor is open, add the following code at the top:

$jp.clickthroughUrlArray = [ 
$jp.getLineItemVariable("PUTVARIABLELABEL","PUTURLHERE"),
];

As you can see, you can add a variable label, or site URL to each of the values above. To do so, delete everything past the $jp.getLineItemVariable( code snippet. Then enter your new label and URL, including double quotes. You'll need to manually enter the code to insure it works properly with the line item. Like the snippet below:

"clickone","http://www.jetpack.net"),

Duplicate the $jp.getLineItemVariable code snippet for every other button. Make sure they each have a unique variable label. Here is an example of what that code looks like:

$jp.clickthroughUrlArray = [  
$jp.getLineItemVariable("clickone","http://www.jetpack.net"), 
$jp.getLineItemVariable("clicktwo","http://www.google.com"), 
$jp.getLineItemVariable("clickthree","http://www.yahoo.com"), 
];

Now save your build, and move on to the line item. Once the build is associated with the line item, you can add the variables, and change them for each button under the Additional Data For Creative option.

525