Automatic keyword inserting affiliate plugin for WordPress

  • 0
  • February 7, 2008

Today we are releasing a new plugin for WordPress that allows you to monetize your long tail traffic better than ever before. The plugin works by taking the keyword that a visitor used to find your site in any major search engine and turns it into an affiliate link.

This plugin works great on product sites and is especially useful if you send visitors to sites like Amazon & Ebay as the visitor will be given a cookie and you get credit for future purchases.

You can customise the link to go anywhere including your site search page if you don’t want to sell products. Screenshots of how it works are below. Please note that I don’t use it on Blogstorm so don’t try to make it work.

Download the plugin here

To install:

  • Upload affiliateplugin.php to your plugins folder
  • Edit buy.php to include your Ebay publisher id or change the link to somewhere else as you wish
  • Upload buy.php to your main directory
  • Activate the plugin
  • Go into your WordPress > Options > Affiliate link options menu and change the link suffix & prefix
  • Add the code below to your Single Post page wherever you want the ad to appear

<?php $referer = $_SERVER['HTTP_REFERER'];
ebay_ads($referer); ?>

Update: You might also like to integrate these scripts-

Redirect outbound affiliate links

Geotargeting with php 

Visitor searches on Google & clicks on your site


Keywords are turned into an affiliate link


Visitor clicks on the affiliate link


Patrick Altoft

About Patrick Altoft

Patrick is the Director of Strategy at Branded3 and has spent the last 11 years working on the SEO strategies of some of the UK's largest brands. Patrick’s SEO knowledge and experience is highly regarded by many, and he’s regularly invited to speak at the world’s biggest search conferences and events.

  • Christian

    This is fantastic, Patrick! Cheers


    • Domainholics

      ditto! What a brilliant idea. There’s loads of potential here!

  • Brilliances


  • Sucker

    I might build some new blogs to take advantage of this!

  • Matthew

    This looks great. I used a similar method to create links automatically to go to Amazon based on location of the user ( or .com), but it didn’t use the search string as the text. Instead I used keywords from the title of the post to determine which ad to show. That worked ok’ish (nothing too spectacular).

    This however should be way more targeted and I expect to see some nice results. If I see some good performance over the next few days I am going to look in to ways to geo target and send users to their correct ebay/amazon site.

    Also I am going to test with a BUY button next week too to see what effect a buy it now type button has over the text.

    • Patrick Altoft

      Good idea about geotargeting, I added a link above to another of my scripts that does this.

    • James

      Nice plugin Patrick!

      In response to Matthew, if you’re looking to geotarget your affiliate links for specific products, there’s a great site called LinkSprinkler where you just set different URLs for different countries, and then copy and paste their link URL onto your page. Whenever someone clicks the link, it sends them to the page you specified for their country, or to the default URL if they’re from a country with no URL specified.

      I use it myself to send people to Amazon USA, CA and UK and it works really well, and gives your affiliate income a nice boost!

  • Pingback: links for 2008-02-08()

  • Alex Ion

    I think I will implement it on my gadgets blog, too.
    It should perform nicely.


  • Tibi Puiu

    Brilliant work Patrick! It’ll definitely come in handy.

  • Pingback: 13 Great Articles - February 10, 2008 | My lucky number 13()

  • Pingback: Sunday Quickies: 10 February - Lost Art Of Blogging()

  • Flavio Copes

    Thanks for this, it will be very useful!

  • weird online

    Patrick, I wish blogspot could have this one. Most of my blogs are powered by blogger.

  • Osita

    Thanks Patrick, this is what I desperately need at the moment.
    Good thinking.

  • Pingback: 6 Wordpress Plugins That Enhance Your Blog's SMO()

  • Sagem

    Does this work with the new WP and more importantly with the new Ebay Network?

    • Patrick Altoft

      It is untested with either so far but it is pretty easy to customise for networks other than ebay so it should be fine.

  • fields marshall

    Very Cool Plugin.

    I going to tweak it abit to make it work like that landing sites plugin – which never worked for me

    I am just going to try and keep people on a webpage a bit longer by saying you searched for xxx on google

    anyways nice job thanks

  • Anders

    I must say this is a very nice plugin. I was having nightmares with integrating SE keywords into my pages… then I stumbled on your great plugin and decided to whack up a blog to side-support my main site.

    Great work and Thanks!

  • patrickd

    this is a great plugin. thank you!

  • Pingback: » Affiliate Plugin for WordPress MarsVenus: A blog about blogging and the current state of the blogosphere.()

  • derek

    how to use this plugin with amazon?

  • Blogging Posts

    It used great, i have add it to my blog site, the keywords have afflilie links and visitor click it, buy sometings, I will get money. hehe

Like what you see? Talk to an Expert