It is possible to dynamically pass some of your own values into the Ad Customizer code. Not all field values are supported. Fields that allow override values are "Search Query" (searchterms), sellers (sellers), store name (storename), width (w), height (h), rows (rows), columns (cols), page background color (outc), link color (linkcolor), text color (fontcolor), border color (cb). Important note: modifying the width and height of an ad also requires adjusting the frame code reference for the frame's width and height.
View some examples of a programmable modifications to a common ad block.
This allows you to create the perfect ad for any keyword situation. It also allows for dynamically colored or sized ads on your pages. See the sections below for examples on Modifying the Search Query, Modifying the width and height, Modifying rows and columns, and Modifying the border color.
In all cases, the first step would be to create the original ad code that you wish to modify. Imagine this code as a template allowing you to safely control a few variable values. Any combination of parameters can be set; if any new values are provided, they simply override the values used in the original ad. Important note: the params value (params=dHM9NjQmYW1wO3R5PXRhJmF...) must never be changed or removed from the ad code or the ad will no longer function.
If your pages are created dynamically already using PHP against a MySQL database, it is possible that your pages' keywords are already saved in a table somewhere. Even if they aren't, it is possible to create a new table and write a little bit of PHP code to achieve this. Our content-sensitive ads will get keywords from your page in the event that an ad returns no items.
This will absolutely increase your click through rate.
Using a page's keywords may not make sense for a search query, so it most-likely would be necessary to create an extra field on a table to store these search terms. For example, if you had a blog with many posts in categories from "Chardonnay" to "Vichyssoise". Your blog tables already contain the category names and possibly tags or another keyword field that would be perfect for using in a search of eBay. On the page that is to display the ad, you would have to store the appropriate search terms into a variable such as $searchterms. It is often best to create a separate file that only creates the HTML for the ad - but has enough PHP code injected to display the value of your variable in the correct place.
You will need to test your search terms out until you are confident that you have a working system. The file is almost like a template, but simpler. An example "custom_ad.php" code: (the code passes a value for $category as well as for $tags, but the code could be modified to use only one parameter)
function getDynAdSearchTerms($category, $tags) {
// notice that the searchterms is wrapped in parenthesis AND URL encoded
// for other search query operators please refer to : http://auctionreporting.com/node/15
$searchterms = urlencode("(".$category .",". $tags.")");
if ($searchterms) {
return '
<!--Begin AuctionReporting.com - Custom eBay ad code -->
<iframe width="728" height="280" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" src="http://betterwindowssoftware.com/customizer/pagead.php?searchterms='.$searchterms.'¶ms=dHM9NjQmYW1wO3R5PXRhJmF...."> </iframe>
<!--End AuctionReporting.com - Custom eBay ad code -->';
}
}
Usually, the size you have available for an ad is a fixed size. Sometimes, you may want to control these values in your script. Here is a simple example that changes the width and height. Notice that this script also needs to set the size of the iframe object. Whatever you do to change the script, make sure that there isn't a case where width or height is blank.
function getDynAdWidthHeight($width, $height) {
$width_frame = ($width <> "") ? 'width="'.$width.'"' : 'width="468"';
$height_frame = ($height <> "") ? 'height="'.$height.'"' : 'height="60"';
$width_param = ($width <> "") ? "w=".$width : "";
$height_param = ($height <> "") ? "h=".$height : "";
if ($width_param) $height_param = "&".$height_param;
return '
<!--Begin AuctionReporting.com - Custom eBay ad code -->
<iframe '.$width_frame.' '.$height_frame.' scrolling="no" frameborder="0" marginwidth="0" marginheight="0" src="http://betterwindowssoftware.com/customizer/pagead.php?'.$width_param.$height_param.'¶ms=dHM9NjQmYW1wO3R5PXRhJmF...."> </iframe>
<!--End AuctionReporting.com - Custom eBay ad code -->';
}
This may be a common need when your site has various themes or styles applied. Matching your border colors exaclty should increase click through rate. You are able to override the border color of an existing block of HTML code by setting the value of the "cb" (color of border) parameter. The value must be passed as a 6 digit HEX color value; failure to validate your ads after this change may cause display errors.
function getDynAdBorderColor($borderColor) {
return '
<!--Begin AuctionReporting.com - Custom eBay ad code -->
<iframe width="728" height="280" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" src="http://betterwindowssoftware.com/customizer/pagead.php?cb='.$borderColor.'¶ms=dHM9NjQmYW1wO3R5PXRhJmF...."> </iframe>
<!--End AuctionReporting.com - Custom eBay ad code -->';
}
In much the same way that you may want to control the other parameters in script, you can set the value for rows and columns. Remember that you may not have more than 20 rows and 20 columns. This example is more simple than the width / height example.
function getDynAdRowsCols($rows, $cols) {
if ($rows > 20) $rows = 20;
if ($cols > 20) $cols = 20;
$rows_param = "rows=".$rows;
$cols_param = "cols=".$cols;
return '
<!--Begin AuctionReporting.com - Custom eBay ad code -->
<iframe width="728" height="280" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" src="http://betterwindowssoftware.com/customizer/pagead.php?'.$rows_param.'&'.$cols_param.'¶ms=dHM9NjQmYW1wO3R5PXRhJmF...."> </iframe>
<!--End AuctionReporting.com - Custom eBay ad code -->';
}
Recent comments
27 weeks 4 days ago
27 weeks 6 days ago
28 weeks 4 days ago
28 weeks 5 days ago
28 weeks 5 days ago
28 weeks 6 days ago
29 weeks 1 day ago
29 weeks 1 day ago
29 weeks 1 day ago
30 weeks 3 days ago