In the previous chapter you learned what custom targeting can do for you, so lets go into the details of passing your data to the ad server to make it work. We'll assume that you have a 468x60 banner zone that you want to enable custom targeting for. What you should do first is generate JSP code for that zone using the code wizard.
If you look at the code that was generated, you'll see something similar to the code that follows.
<advertpro:banner host="www.yoursite.com" port="80" path="/adserver" zone="123" publisher="0" width="468" height="60" hspace="0" vspace="0" border="0" alt="Click Here!" target="_top">
</advertpro:banner>
What you need to do is add extra parameters for each of your custom fields to this code. When one of your web pages is served, you'll need to output the data into the values of those parameters. Where that data actually comes from is of no concern to the ad server, so you're free to use any datasource you have available for use such as but not limited to a cookie, flat file, database record, or a user session object.
Lets look at an example of the above code modified to pass the value 12345 using Custom Field #1 for the custom field.
<advertpro:banner host="www.yoursite.com" port="80" path="/adserver" zone="123" publisher="0" width="468" height="60" hspace="0" vspace="0" border="0" alt="Click Here!" target="_top">
<advertpro:custom field="1" value="12345"/>
</advertpro:banner>
With that integration in place, it's now possible for you to target campaign to the value 12345 using Custom Field #1. That's assuming you're using the EQUALS operator of course. Many other operators like GREATER THAN and even REGULAR EXPRESSION are available to let perform some really complicated matching logic. That said, further help with using the various operators is available in the context help of the custom field editing screen, which you can reach by editing a campaign and selecting Custom Targeting from the Change View drop down menu.
In most cases, you will probably have a list of preset data values that you would like to target your campaigns to. You may pass such a data list into the user interface so that you can select data values to target instead of having to type them in. To do this, go to Settings > Basic > Custom Fields in the contorl panel and enter the URL of an XML feed into the Field Values input box for the desired custom field.
Your XML feed may be static or dynamically generated, but it must adhere to the following syntax.
<?xml version="1.0"?>
<dataset>
<entry name="One" value="1" />
<entry name="Two" value="2" />
<entry name="Three" value="3" />
</dataset>
There is no limit to the number of data field entries, however, you may experience performance issues if your feed contains more than a few hundred or thousand entries.
In the previous chapter you learned what keyword targeting can do for you, so lets go into the details of passing your keywords to the ad server to make it work. We'll assume that you have a 468x60 banner zone that you want to enable keyword targeting for. What you should do first is generate JSP code for that zone using the code wizard.
If you look at the code that was generated, you'll see something similar to the code that follows.
<advertpro:banner host="www.yoursite.com" port="80" path="/adserver" zone="123" publisher="0" width="468" height="60" hspace="0" vspace="0" border="0" alt="Click Here!" target="_top">
</advertpro:banner>
What you need to do is add extra parameters for each of your keywords 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 values blue coat, windbreaker, and parka to indicate that the phrase blue coat along with the keywords windbreaker and parka were searched for.
<advertpro:banner host="www.yoursite.com" port="80" path="/adserver" zone="123" publisher="0" width="468" height="60" hspace="0" vspace="0" border="0" alt="Click Here!" target="_top">
<advertpro:keyword value="blue coat"/>
<advertpro:keyword value="windbreaker"/>
<advertpro:keyword value="parka"/>
</advertpro:banner>
With that integration in place, it's now possible for you to target a campaign to the phrase "blue coat" or the keywords windbreaker and parka. The ad server always does case insensitive matches, so you don't need to worry about case sensitivity. You should, however, be aware that the ad server will perform stemming matches if you don't place your keywords or phrases inside of double quotes. More details on this behavior can be found in the context help of the keyword editing screen, which you can reach by editing a campaign and selecting Keyword Targeting from the Change View drop down menu.