The HTTP Handler provides two services for the banner manager:
- Loading Scripts to display Banners
- Tracking Clicks
Load Script Include Code to Display Banners
The handler is responsible for loading the script code that displays banners in the page inside of an IFrame. The script then uses JavaScript to write the document content that contains the banner dynamically to prevent robots from 'seeing' banner links and clicking and following them.
Script urls generated reference the Http handler and cause it to load the specified JavaScript to display a given banner. The a=s querystring parameter specifies to load the script code to display the banner.
The following Url loads the next banner in the dotnet category (note that the handler name is configurable):
<script src='/Weblog/wwBanner.ashx?&t=633473068200376000&a=s&c=dotnet' type='text/javascript'>
</script>
The following script include loads a specific banner based on the id= parameter passed:
<script src='/WebLog/wwBanner.ashx?id=41231111&t=633473068200376000&a=s' type='text/javascript'>
</script>
The above syntax is automatically generated by RenderBanner() or RenderNextBanner() to show banners, so you never need to manually type in these script includes, but rather use:
<%= BannerManager.Current.RenderBanner("1231222") %>
<%= BannerManager.Current.RenderNextBanner("dotnet") %>
or similar to embed the banner content.
Tracks Clicks
The handler also tracks clicks if click tracking is available. Clicks are automatically routed to the click handler that keeps track of all clicks made against the ad. Note that non image ads (ie. Flash, Silverlight) must explicitly call these click URLs or a special javaScript snippet to participate in click tracking.Actions (a parameter)
The HttpHandler handles three distinct tasks which are routed via the a= url querystring parameter.The following actions are handled:
- a=s - Script Include
Loads the script to display a specific banner in an IFrame. Done to so script loading occurs independent of main page and to minimize Robot tracking or interfering with script links.If an ID parameter is also passed that particualar banner is loaded, otherwise GetNextBanner() is called to retrieve the next banner in the category specified (c parameter) is loaded.
- a=c - Banner Click
Handles click tracking for the banner. Click Tracking is automatically hooked up
© West Wind Technologies, 1996-2016 • Updated: 12/15/12
Comment or report problem with topic