Paramaterized Ad Targeting


Runtime Ad Tag URL targeting

Set user data against player: Target Hotel Ad Target Hooroo
// Within VAST config we pass the custom macro: 
'vast': {
	'numPreroll':"1", 
	'prerollUrl': localPath + 'targetAds.php?target={myAdTarget.target}' , 
	'loadAdsOnPlay': true
	...
}

// Within the button click handler we set the custom property)
'readyCallback': function( playerId ){
	var kdp = $('#' + playerId )[0];
	
	$('#targetHotel').click(function(){
		kdp.setKDPAttribute('myAdTarget', 'target', 'hotel');
	});
	$('#targetHooro').click(function(){
		kdp.setKDPAttribute('myAdTarget', 'target', 'hooroo');
	})
}