Version 5.0
AdvertServe User Manual :: v5.0

Keyword Targeting - AJAX Code Integration

Original Code

You should now have a generated AJAX zone code from the code wizard that looks like the following:


<script type="text/javascript">
  var _avp = _avp || [];
  (function() {
    var s = document.createElement('script');
    s.type = 'text/javascript'; s.async = true; s.src = 'http://adserver.example.com/js/libcode3.js';
    var x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(s, x);
  })();
</script>

<div id="avp_zid_7">
  <script type="text/javascript">
    _avp.push({ tagid: 'avp_zid_7', alias: '/', type: 'banner', zid: 7, pid: 0 });
  </script>
</div>

Modified Code

What you need to do is add a parameter to this code on your search results page to pass the keywords that were searched for to the ad server.

Lets look at an example of the above code modified to pass the value blue coat,windbreaker,parka to indicate that the phrase blue coat along with the keywords windbreaker and parka were searched for.


<script type="text/javascript">
  var _avp = _avp || [];
  (function() {
    var s = document.createElement('script');
    s.type = 'text/javascript'; s.async = true; s.src = 'http://adserver.example.com/js/libcode3.js';
    var x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(s, x);
  })();
</script>

<div id="avp_zid_7">
  <script type="text/javascript">
    _avp.push({ tagid: 'avp_zid_7', alias: '/', type: 'banner', zid: 7, pid: 0, keywords: 'blue coat,windbreaker,parka' });
  </script>
</div>

Tip Tip