Control Panel User Manual

Keyword Targeting - JavaScript Code Integration

Original Code

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


<SCRIPT src="http://adserver.example.com/js/libcode1_noajax.js" type="text/javascript"></SCRIPT>

<SCRIPT type="text/javascript">
if (document.avp_ready) { avp_zone({ base: 'adserver.example.com', type: 'banner', zid: 7, pid: 0 }); }
</SCRIPT>

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 src="http://adserver.example.com/js/libcode1_noajax.js" type="text/javascript"></SCRIPT>

<SCRIPT type="text/javascript">
if (document.avp_ready) { avp_zone({ base: 'adserver.example.com', type: 'banner', zid: 7, pid: 0, keywords: 'blue coat,windbreaker,parka' }); }
</SCRIPT>

Tip Tip

Parameter values will be URL encoded automatically, so you do not manually encode them. However, both encoded and decoded forms are accepted. Parameter values are checked to detect if they are already encoded so they will not be encoded twice.

Warning Warning

When not using JavaScript variables to hold your parameter values, remember to place your values in quotes as shown in the example!

Note Note

Multiple keywords and phrases may be passed to the ad server using a single parameter. Simply delimit the keywords or phrases (without double quotes) with commas. The ad server will only require one of the set to be a match. However, you can specify each keyword is required by prefixing them with a plus symbol or to be excluded by prefixing them with a minus symbol.