![]()
|
You are here: Home > Articles > Linking Link Interception - A Better Way to do Affiliate Programs and Link TrackingHow can you keep the crawlers crawling? Help your affiliates, advertisers or linked to partners get their linked-to points to help their search rankings? All while doing click tracking using your own system? This page will explain how to intercept the user's click with a JavaScript call to redirect the user to a different page than in the HTML link (A HREF). The benefit of this is to allow you to keep all your links crawlable by the search engines, but track them with your own code when an actual user clicks on them. The problem with traditional link trackingSearch engine web crawlers don't do Javascript. When your link is a JavaScript function, it wont't get followed by a web crawler and your link won't benefit your customer's page rankings or worse, for your own website some pages won't get indexed at all. There are two popular ways to do link tracking today: Traditional linking or Javscript CallsA traditional link such as: or Javascript as the HREF value: <a href="javascript:parent.location='http://www.stellarwebsolutions.com';">StellarWebSolutions.com</A>
StellarWebSolutions.com Similarily Javascript Function calls as the HREF value: OnClick Javascript action handlersThe more common method now is to place a "#" in the HREF link,
and use a onClick handler to process the link: The Solution - A better way to track links!Keep the HREF as the real URL to your target (for the web crawlers), but use the onMouseOver function to dynamically change the link location that actual users will follow to your link tracking software or other entry link: <A HREF="http://www.stellarwebsolutions.com/linkdoesntgo/here" onMouseOver="href='http://www.stellarwebsolutions.com/';">StellarWebSolutions.com Intercepted Link</A>
StellarWebSolutions.com Intercepted Link And with a JavaScript function: <A HREF="http://www.stellarwebsolutions.com/linkdoesntgo/here" onMouseOver="javascript:linkHandler2(this);">StellarWebSolutions.com Intercepted Link</A>
StellarWebSolutions.com Intercepted Link And to open the link into a new window: <A HREF="http://www.stellarwebsolutions.com/linkdoesntgo/here" onMouseOver="href='http://www.stellarwebsolutions.com/'; target='_blank';">StellarWebSolutions.com Intercepted Link</A>
StellarWebSolutions.com Intercepted Link | ||||||
|
| |||||||