Target ads in the instant messenger

Due to the fact that all settings of your IM application are part of the implementation script, it is very easy to target ads towards your user. For example: if you want to show women, who are older than 25 a different banner, than all of the other users, your script could look like this:

Example to set the javascript variable my_banner_code to “25+ woman” if the users is a woman older than 25 (for the rest: my_banner_code=“all other users”):

<script type="text/javascript">
<?php
if ( ($user->age > 25) && ($user->gender=="w") ) {
  echo 'var my_banner_code="25+ woman";';
}
else {
  echo 'var my_banner_code="all other users";';
}
?>
</script>

Pass banner code (my_banner_code) to the implemenation code:

<script type="text/javascript"> 
  var TOKSTA_CONFIG = { 
  app_id: "your-application-id", 
  user_id: "the-user-id", 
  user_hash: "the-user-hash", 
  user_data: "the-user-data", 
  generated: "current-unix-timestamp", 
 
  //adjustments needed
  show_banner:true,
  banner_code: my_banner_code
  }; 
</script> 
<script src="http://embed.toksta.com/embed/toksta.js" type="text/javascript"></script>
 
target_the_ads_in_the_instant_messenger_to_your_users.txt · Last modified: 2009/06/28 17:54 by mg
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki