Using Google Analytics or Optimizer on Outbound Links with WordPress

GUEST POST by Bradley Spencer

Hey readers of Jonathan’s Blog. Today I’m going to share with you the exact code I use to make my affiliate links a lot prettier without having to buy a script or software or anything. And it only takes about two minutes and works with WordPress, Drupal, Blogger, or any CMS for that matter. And best of all you can track everyone who uses the hoplink in Google Analytics or Google Website Optimizer. This is the same system I created as ‘the missing link’ for using Google Website Optimizer to split-test my landing page at and the system I use every day at my affiliate sites.

The problem I had before (that this solves) is that my affiliate links were ugly and people didn’t want to click on them, and also that I had no way to keep track of how many people I’d sent to a merchant from within Google Analytics. And, maybe most of all, I had no place to put the code that Google Website Optimizer gave me to put on a ‘conversion page’ But this little file solves all of that. Sounds great, huh? Well let’s dive right in.

Step 1:

You are going to need a few very common tools to make this work. So the first thing we want to do is gather those tools. Here is what you are going to need:

  1. FTP Access to your server
  2. Text Editor (any will do, but not a big word processor like Word that adds markup. You need a lo-fi text editor)
  3. Download this file which gives you example code you can use to get up and running in minutes.

Step 2:

Once you have your FTP connected, your text editor warmed up, and you’ve downloaded the file from Step 1 above, just watch this video to see how to get set-up.

Making the Most of Your Hoplinks:

So far the best reasons I’ve found for having these hoplinks are that they are better looking links than most affiliate links and that you can use goal tracking to see how many people you send to your merchant. If you can think of other uses for these hoplinks, then by all means leave a comment. I’m always looking for new uses.

About the Author:

Bradley Spencer is a WordPress and SEO consultant who can help you make the most of marketing with wordpress.

There are no comments yet. Be the first and leave a response!

Leave a Reply