SEO Blog & Search Engine Optimisation Tools

Ragepank is the SEO blog of Harvey Kane, a New Zealand PHP web developer and SEO consultant, specialising in on-page SEO.
Search engine optimisation articles & tools are published in the blog regularly, covering the technical sides of on-page SEO (which most sites do really bad), link building tricks, what Google is up to, and the human element of this crazy business.

Is your website SEO working, or just cheesy?

Even big companies have plenty room to improve their on-page SEO. Of the many websites I visit each day, there aren't many that I couldn't suggest a couple of changes that would improve rankings one way or another.
Some websites just need small changes to see big results. Others need to rethink what value they have to add to the world, and the marketing has to start here.

Site contents

This blog can be thought of as a Search engine optimization (SEO) resource for intermediate level webmasters. Beginners might be scared off by PHPSESSID and duplicate content, but it's all important stuff if you want to compete with the big fellas.
  • SEO Articles / Blog - A couple of entries a week covering whatever is happening at the time. I like to think my SEO articles are interesting and relevant to website owners wanting to add a measure of quality to their sites
  • SEO Tools - The spam-o-meter is still a popular SEO tool for ranking the desireability of a link exchange partner. Also check out the redirect tool if you think your site is totally free from duplicate content problems (most aren't)
  • SEO Consulting / SEO services - Yes, I do offer paid SEO consulting, as well as the monkey work it usually entails

Hiding ugly affiliate links using Javascript

At some point in your affiliate career (usually earlier rather than later), you will come across affiliate links that look a little bit too much like affiliate links.

I'm talking about www.example.com/?AFFILIATE_ID=1234 and similar format links. Nothing screams "I AM AN AFFILIATE LINK" like having the word "affiliate" in the URL.

I'm a big fan of disclosing your interests, but the amount of disclosure does depend on the context. For example - if the affiliate link is in the sidebar and looks like an ad, you don't want to reinforce that it's an ad by drawing attention to the affiliate ID in the URL. While it's good to make it obvious that a link is financially motivated, you don't want to make it *too* obvious. Generally speaking, I really don't like big obvious affiliate links.

However, as an affiliate you have to use whatever format link you are given. If the link format contains a big obvious affiliate ID, here's one effective way to make it go away.

Javascript

Javascript is an interesting demon. It receives a lot of flack, but it's actually brilliant. Anything done using javascript does require a little extra thought - you need to design the script to work well for users with javascript, but also ensure that the page doesn't fall to bits for users without javascript.

What we are going to do is use the affiliate link on the web page as per normal. Our javascript will modify the link to remove the ugly affiliate ID, then when the user clicks on the link, the affiliate ID is re-attached. If the user doesn't have Javascript enabled, none of this trickery happens and they just see the normal affiliate link.

Let's consider you want to link to www.example.com?prod_id=765 (a normal page) but you want the affiliate commission for any clicks. So you actually need to link to www.example.com?prod_id=765&AFF_ID=1234 - but you don't want to show the "AFF_ID=1234" to the user.


  1. We create a HTML page containing the original affiliate link amongst the content.
  2. We make up a list of all the affiliate links we want to use across the site - we record the affiliate version of the link (eg www.example.com?prod_id=765&AFF_ID=1234) and the non-affiliate version (www.example.com?prod_id=765) in our Javascript file.
  3. Once the page loads, our Javascript scans all the links on the page. If any link on the page is in our list of affiliate links, it gets replaced with the non-affiliate version of the link.
  4. When a user clicks on a link, it gets replaced with the affiliate version of the link just before they leave the page. They arrive at the merchant's site with the affiliate ID intact.

All this happens rather seamlessly in the background. And thanks to jQuery, the code required is fairly minimal.

A word of caution

It's worth pointing out that users don't like being tricked. And with the purpose of this script being to show you one link when you mouseover, and send you to a slightly different link when you click, there's definitely the potential for this to be seen as misleading.

I would suggest that this script is only used where there is some form of disclosure already happening on the page. It's easy for a visitor to look at the source code and see what it really going on, and people don't like to be mislead.

Good examples:

  • I have used company X and found them to be well priced - www.example.com (aff)
  • This site is sponsored by www.example.com
  • Browse top quality X from www.example.com (with the text being situated where it obviously looks like an ad, not content)

Bad examples:

  • Yeah, you should check out www.example.com
  • I recommend www.example.com as they are good to deal with

With the good examples, the user can reasonably conclude that the link is paid, so (in my opinion) there is no harm in masking the affiliate ID in the URL. With the bad examples, the user would reasonably assume that an unbiased recommendation was being made, and are likely to get angry if they find out that is not the case.

Google adwords is a classic example of the link not truly representing the destination. But because the ad is disclosed as being paid, and the destination URL isn't too far different from what was advertised, people don't get upset. Follow these guidelines, and there is nothing to worry about.

See this script in action

You can see a stripped-down example of this technique here. Mouse-over the example link - If the link looks normal, this means the script is working. If you see an affiliate ID in the link when you mouseover, either you have Javascript disabled, or there is an error in the script. In either case, the link will still work and you still get your commission.

Download

Download a copy of hide affiliate links. Code is LGPL licensed. If you like it, please consider placing a link to www.ragepank.com or www.capsaicin.co.nz, which always puts a smile on my face.

Installation


  1. Upload the included jQuery Javascript file, and link to it in the <head> of your HTML, eg:
    <script type="text/javascript" src="jquery-1.2.3.pack.js"></script>


    Alternatively, link to Google's copy of jQuery:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script>


    Note that jQuery is approx 20kb - that's a lot of extra weight to add to the page if you aren't already using jQuery for something else. Luckily jQuery is awesome, and easily justified on most sites.

  2. Edit aff.js - add all your affiliate links into this file in the following format:
    aff['http://www.domain.com/AFFILIATE_LINK/'] = 'http://www.domain.com/REGULAR_LINK/';


  3. Link to aff.js in your HTML - this must appear after the jQuery link:
    <script type="text/javascript" src="aff.js?v=1"></script>


  4. Link to affiliate URLs as you normally would throughout the site content, using the Affiliate URL.

  5. If you need to modify aff.js for any reason you will need to update the version number in the code used in step 3 - otherwise aff.js will be cached by visitor's browsers, and they won't see your updated code. Simply increment the version number each time you make a change:
    <script type="text/javascript" src="aff.js?v=2"></script>



Enjoy.
View all Articles...

Content at a Glance

  • Spam-o-Meter - A tool for checking the quality of potential link partners.
  • Disable PHPSESSID - Remove the evilness of PHPSESSID from your site for good.
  • Optimise your Images - Don't forget to make sure your images are search engine friendly. Here's how.
  • Sort your Navigation - Users and search engines like good navigation. Have you missed anything important?
  • Check out the features on Jojo CMS

The NZ SEO Blog

A collection of NZ SEO blog articles written by New Zealand Web Developer Harvey Kane, as well as a (small) selection of non NZ SEO Articles from other authors. As an established NZ SEO, we can also offer SEO NZ services for NZ websites.

Services

  • Auckland SEO services
  • Content Management System (CMS) websites
  • New Zealand search engine optimization
  • NZ SEO consulting
  • Web development & Web design

Sites under development

These are some of the search engine optimisation and web development projects I have on at the moment...
Debug Mode currently enabled.
This has an impact on performance and should be turned off before the site is made live.