Targeting Ads using site variable
You can target the ads using the Site Variable delivery limitation on the delivery limitations page of a banner. Suppose you want to display your ads to the users who are male. Go to Delivery Options> Site - Variable for any banner.Then you will have to create a variable name and a value for that variable. We will create a site variable ‘gender’ here and the ‘male’ as value. Select ‘is equal to’ from the dropdown.
The banner for which we have assigned the delivery limitations will be displayed for the invocation code which contains the site variable ‘gender’ and male as value.
Now in invocation code you have to add some statement which will add the variable. You require some coding knowledge to add the statement in invocation code.
Here is an example using basic PHP using a JavaScript invocation tag from OpenX.
Here is the part of a typical JavaScript tag:
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=5");
document.write ('&cb=' + m3_r);
document.write ("?zoneid=5");
document.write ('&cb=' + m3_r);
What you want is a line after the zoneid which adds a site variable and value, like:
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);document.write ("?zoneid=5");
document.write (’&gender=<?php echo $user['gender']; ?>’);
document.write (’&cb=’ + m3_r);
It will look like when rendered by the website would be ‘ajs.php?zoneid=5&gender=male’. The actual code will be of course different depending on your website and how you store user data.
Basically the purpose is to pass the variable name and value after the delivery file name. So for iframe it would be ‘afr.php?zoneid=5&gender=male’. For Single page call it would be something like this ’spcjs.php?id=1&gender=male’.
- OpenX:
- admin's blog
- Login or register to post comments

RSS
Twitter
Facebook
FriendFeed
Myspace
Linkedin