WinkPress
Now Reading
Affiliate Links Manager for WordPress
Bright Idea
117

Affiliate Links Manager for WordPress

updated by MizagornFebruary 27, 2015
by M. K. SafiFebruary 3, 2011

With this plugin you can:

  • Create simple URL redirects like http://example.com/a/blue-product/ or http://example.com/visit/red-product/.
  • Track clicks in your Google Analytics account.
  • Reduce load on your server — this plugin handles redirects in a very efficient way.

Requirements: I tested the plugin with WordPress 4.1.1 and PHP 5.5. It has also been tested with versions down to WordPress 3.1 and PHP 5.3. It may still work with older versions. Your site must be using pretty permalinks. To get click tracking, your site must be pre-configured with Google Analytics.

Note on Updated Version 1.2

I took over management of this site and discovered that WinkPress has a plugin! Updates have been made to make the plugin easier to understand and URL validation strictness has been lessened quite a bit to allow for non-www URLs.

However, I have not yet gotten access to the WordPress repository to allow for the usual update method within the admin area. To use the updated version, you will first need to uninstall your current version, and then delete it. Otherwise you will get a “folder already exists” error when you install the new version. No worries, because the links you have already set up will still be stored in the database.

Download WALM 1.2 here. (You can right-click and select “Save link as…” to bypass your download manager if you want.)

Then in your admin area, go to Plugins>>Add New, and click the “Upload Plugin” button at the top of the page. Click the “Choose File” button and navigate to where you downloaded v1.2.

Select the affiliate-links-manager.zip file and click “Open”. You will then click “Install Now”. The new version will be installed, and you can activate it. You will find all your links are still there, and hopefully the plugin will be more friendly to your URLs.

Thanks to M.K. for creating such a great plugin. It’s much more complicated on the inside than it is on the outside!
~Mizagorn

How to Use

The plugin menu is found under “Links” in your WordPress admin sidebar. Simply go to “Add an affiliate link” page by clicking on Links>Affiliate Links from your admin menu.

where-to-find-walm-menu

 

  • Enter a human-friendly name for your link.
  • Enter the original affiliate link that you get from the vendor.
  • Enter a short link.
  • Click the “Add link” button.

WALM Add Link

Now your short link will redirect to your original affiliate link. And when your short link appears on your WordPress site, the clicks it receives will be tracked in Google Analytics.

One:

For performance and functionality reasons, your short link must be at least two levels. The first level is for your trigger (see below) and the second level is used to identify the specific affiliate info of the Original Link you put in.

Bad: http://example.com/level-one (Does not allow WALM to work.)

Good: http://example.com/level-one/level-two

Also good: http://example.com/level-one/level-two/level-three

Two:

If you have a web page on your WordPress site whose permalink begins with, say, articles — like http://example.com/articles/7-tips-to-dominate-planet-earth, do not use the word articles as the first level of your short links.

That is, a short link like http://example.com/articles/some-product would be bad. This would cause conflicts with already existing category slugs, tag slugs and any other type of slug.

How Tracking Works

Whenever you enter a new short link, the plugin saves the first level as a “trigger.” For example, in http://example.com/a/product/ the trigger is /a/. The plugin will save as many triggers as you are using in your affiliate links.

Now in your WordPress site, when you link to any page using a URL that has a trigger in it, the plugin will add some JavaScript to your <a> tag to track clicks in Google Analytics.

So, if you have a link like:

<a href="http://example.com/a/product/">affiliate link</a>

The plugin will transform it into:

<a onclick="javascript:_gaq.push(['_trackPageview','/a/product/']);" href="http://example.com/a/product/">affiliate link</a>

And that’s how clicks are recorded in your Google Analytics account.

(Credit: I got the content scanning and tracking code from Google Analytics for WordPress by Yoast. It is my favorite Google Analytics plugin and it is the one I use in combination with WALM.)

This is how the Google Analytics report will look like: (Mizagorn note: these are a bit dated and I will get them changed when I can, but they are good for an idea of the data you will see.)

google-analytics-report

And this is how your affiliate links will be listed inside WALM:

walm-aff-links-list


Download

Download from WordPress.org »Please temporarily use the instructions at the top of this post. 😉


Support

If you have questions, bug reports, or feature requests — post in the comments or visit the plugin support page.

If you wanna say thanks, I’d really love it if you linked to WinkPress from your site.

Or give a friendly like and share via social media at the top of this article.
If you have successfully used this plugin, vote that it is compatible with your WP version.
Thoughfully consider an honest review.

What's your reaction?
Wink It
100%
Interested
0%
Meh...
0%
What?
0%
Sad
0%
Kill It
0%
About The Author
Profile photo of M. K. Safi
M. K. Safi
117 Comments
1 2 3
  • Steven
    May 23, 2014 at 6:12 pm

    Any update on removing the validation? Never looked like you got round to it :-(

  • December 1, 2013 at 1:18 am

    When I turn the plugin on all internal links disappear. I don’t just mean the link stops working, any text that is part of the link is no longer in the post.

    I have no affiliate links set up. All external links are unaffected. All internal links in the sidebar and menus remain unaffected.

    Any ideas?
    Clare

    • February 27, 2015 at 2:47 am

      I have similar problem any solution? WP 4.1.1

    • Profile photo of Mizagorn
      February 27, 2015 at 2:49 am

      Hi Marcin,

      First wanted to apologize for the out of date content. I have just taken over management of the site and I’m working on a modern version with updated content coming soon.

      In the meantime… This site itself is running the plugin on WP 4.1.1. Do you have Pretty Permalinks set up?

      Also, I find that the plugin version on this site is 1.1, which is not available in the WordPress repository. I have no idea (yet) how to get that updated, but I can upload the newer version somewhere for you to access if you want to give it a try.

      Let me know what I can do to help, and we’ll see if we can get this working for you! 😉

    • Steve
      February 27, 2015 at 2:50 am

      Hi Mizagorn! Would love to try the updated version – has the data validation been fixed?

      Cheers!

    • February 27, 2015 at 2:51 am

      Wow thx for fast reply i will check this during weekend and give some more info about my problem :)

    • Profile photo of Mizagorn
      February 27, 2015 at 2:53 am

      Steve and Marcin:

      Here is a link to what is supposed to be version 1.1. I have not yet had time to take a look at the code (however, if this does not work for you guys, then I will make it a priority).

      WALM 1.1 (Hint: Right-click and select “Save link as…” to bypass your browser download manager if you want to.)

      If this doesn’t work for you, then please uninstall it and re-install the 1.0 version via the WordPress repository.

      I installed the updated version on two other sites, but they both give me a “Cheatin’ Uh?” error page when I go to Links>>Link Categories. Note: Although deleting this plugin only deletes the files and not any database entries, it might be a good idea if you have the ability to back things up first. Which is a good idea regardless. However, I “downgraded” the 1.1 version back to the 1.0 version and did not lose any entries. Still says I’m trying to cheat, though! 😕

      My tests were on two different themes by two different vendors, and this was a big “issue” with WordPress v3.2 and up for a *lot* of themes and plugins (mainly about media uploading), so I will need to research that if y’all have problems in that regard. However, as I said, it is working fine on this site.

      If either of you could provide details as to error messages then I would be greatly obliged!

      In the meantime, if you have a chance, please take a look at this same article (minus our current comments) on the new site I am creating, and let me know if you think it will be a better experience for everyone. It is not finished, of course (or it would already be live lol). 😉

      WinkPress Staging Area

    • Profile photo of Mizagorn
      February 27, 2015 at 2:54 am

      Wow, always something to learn in the world of WordPress.

      I had assumed, because most sites I’ve worked on don’t have it, that the entirety of the “Links” admin menu was created by WALM. That is not the case. Only the “Affiliate Links” option pertains to the plugin.

      That vastly narrows the scope of our problems, eh? The “Link Categories” issue I mentioned is not relevant to this plugin. There are just a few files to look at to get updated where needed.

      So, again, as any developer would ask (especially since this site is not having any issues so I have no idea what to look for), please let me know what messages or actions you see that are wrong so I can track it down and get it fixed for you. This might help others having the same issues as well!

    • Steven
      February 27, 2015 at 2:56 am

      Hey Mizagorn!

      Good work with the new site – looks great!

      The issue I was having was that it was coming up with the following error:
      “Your original link doesn’t look like a real link: http://t.dgm-au.com/c/*****/******/****”

      With some tweakin, I’ve worked out that a link has to have the “www” and no “-” in order for it to work:
      http://www.dgmau.com/c/*****/******/****”
      The link above will save correctly but obviously won’t link to the correct page that I want it to.

      So if these constraints were removed from the plugin, then it would work for the URLs that I have :-)

    • Profile photo of Mizagorn
      February 27, 2015 at 2:58 am

      Great Steve! Awesome info, and I know pretty much where to look for that. Your help is very much appreciated. (And thanks for the kind comment as well!)

      I will take a look and let you know. I don’t know exactly how long it will take, but I suspect 2-3 hours. So maybe you will have something nice waiting for you in the morning, unless you are in another time zone (Central USA here) or you are a night owl like me. 😉

    • Steven
      February 27, 2015 at 2:59 am

      I’m in Australia so it’s still early here :-)

      Thanks for the great support!

    • Profile photo of Mizagorn
      February 27, 2015 at 3:00 am

      OK, here is version 1.2. It reduces the strictness of the URL validation and adds some helpful hints and styling.

      WALM 1.2
      (This is the same link I posted above, so if you downloaded it earlier, you will need to do so again. This is so the plugin will have the same name.)

      You will need to uninstall your existing plugin, and then install this version using the “upload” function (or you will get a “folder already exists” error). I haven’t gotten around to getting access to updating the plugin in the WP repository yet. Deleting and manually installing the plugin will not erase any links you have already set up.

      I did not look at the missing link text that Clare posted about when starting this comment thread. If it continues to be an issue I will take a look.

      I tested this with your affiliate link example. Let me know if you have any issues or suggestions! Thanks very much for the help.

    • Steven
      February 27, 2015 at 3:01 am

      Worked a treat! Cheers – would definitely get it updated on WordPress.org :-)

    • Marcin
      March 4, 2015 at 9:02 pm

      AWESOME WORK THX for that update :) greetings from Poland

  • November 3, 2013 at 3:17 am

    Just wondering if anyone has tried this on wp multisite?

    Seems to work OK for me as Super-Admin, and I can see the plugin in the dashboard of all other user accounts. However, it’s not visible in the dashboard for other users on their own sites?

    Anyone come across this and manage to work it out?

    Thanks

    Matt

You must log in to post a comment