Cloak-Expert: Affiliate Links Cloaking plugin for Joomla 1.5

~Vishal Ag.(2009)~

System Requirements:

                • Joomla version 1.5.0 or newer.

Plugin installation on Joomla:

1. Go to your Joomla Admin area.
2. In the Extensions Menu at the top, select Install/Uninstall option.
3. In the Upload Package File section, click Browse and select the CloakExpert4.zip plugin file. Then, upload and complete the install.
4. Now, once plugin is installed you need to enable the plugin if its not enabled by default by Joomla. For this, select Plugin Manager from the Extensions menu at the top.
5. Look for the plugin named Cloak-Expert 3.5 in the list and see if it is enabled. If not, then Click on the cross and enable it.

Plugin Configuration:

6. Click on the name of plugin. This opens up Plugin:[Edit] page where you can configure the plugin.
7. Set the Order to last(largest value in drop-down box). And make sure that "Enabled" option box is selected.
8. Click Save button to save the settings.

How the Plugin Works?

Ok, now we are done with installation and configuration part. Lets see how to use it.

1. Basically the idea is that you have to tell the plugin which links in your articles(yes, Joomla Articles) you want to hide/cloak from the visitors so that they see neither the external link nor your affiliate codes and other information in the link.
2. Select article manager from Content menu. Open your article(with affiliate links in it) for editing. For this, you can also use Joomla's article editor in HTML-view mode. There is an 'HTML' icon in the article editor, which allows you to view and edit the html source of the article.

1. Simple Links

3. For example, if your current link looks like this -
<a href="http://www.amazon.com/bestsellers/ref=sv_sw_h__3&
affiliate_code=98280098"> 
Amazon best seller </a>

Now, simply enclose the anchor element(link) within [CLOAK] and [/CLOAK] tags.(CLOAK is case-insensitive, you can use lowercase if you want) So, now it becomes,
[cloak]<a href="http://www.amazon.com/bestsellers/ref=sv_sw_h__3
&affiliate_code=98280098"> 
Amazon best seller </a>[/cloak]

4. Save the article or apply changes. You are done!
5. To check if its working, open a new browser window and load your Joomla website. Navigate to the article you just edited and hover over the link to see if cloaking is working.

Now, if you right-click and do 'View Source' on the article page, you will find something of this sort -
http://www.your-joomla-site.com/content.php?module=eAEB
VACr%2F0JoMFpHVTVwQUlBQWdPQVFkRENodEFIQVpHRXg1R0R3d0hHaG
9JQlJnTd0VQR1I0VkhBeENHeEVJVkI0Zkt4MGVNZ0VyTVZvPV40Gq8%3D

This is what people get to see instead of your affiliate links. Something totally meaningless! So, only thing you need to do is, enclose your links within the cloaking wrapper tags so that Plugins knows which links to secure. The actual redirection and cloaking is handled by the joomla plugin automatically.

2. Hiding the links from the browser Statusbar(IE7 supported)

The newer version of browsers like Internet Explorer 7 and Firefox doesn't allow muting of statusbar anymore, through javascript. In addition to this, they don't allow Javascript code to write anything into the statusbar in a way that will hide the actual URL links(when user hovers mouse pointer on links). This feature has been a security feature of new browsers to prevent websites misleading users. But, though their intentions are good, this creates an issue for genuine users like affiliate marketeers who need to protect their revenues.

The plugin includes an alternative method to get around this(with a rule*). Add a statustext argument to the cloaking tag, with a Valid URL you want to display in statusbar when user hovers the mouse pointer over the secured link. So it becomes,

[CLOAK statustext="http://www.amazon.com"]<a 
href="http://www.amazon.com/bestsellers/ref=sv_sw_h__3&
affiliate_code=98280098">Amazon best seller </a>[/CLOAK]

*Important Rule to remember while using statustext argument: The text you place in statustext has tobe a VALID URL. That means, it must start with http://(or https, ftp etc.). Otherwise, it won't show up correctly in the browser statusbar.

3. Links with id or CSS styling Attributes

The plugin preserves your id and styling attributes defined on the anchor element(<a .. >).
[CLOAK statustext="http://www.amazon.com"]<a id='url_amazon' 
href="http://www.amazon.com/bestsellers/ref=sv_sw_h__3&
affiliate_code=98280098">Amazon best seller </a>[/CLOAK]
[CLOAK statustext="http://www.amazon.com"]<a id='url_amazon' 
href="http://www.amazon.com/bestsellers/ref=sv_sw_h__3&
affiliate_code=98280098" class='links'> Amazon best seller </a>[/CLOAK]

4. Image Links and Banners

You can also put image links and banners within the [CLOAK] tags.
[CLOAK ]<a id='url_amazon' 
href="http://www.amazon.com/bestsellers/ref=sv_sw_h__3&
affiliate_code=98280098"><img src="http://www.your-joomla-site.com
/banners/shop-ad-books.jpg" alt="Banner" border="0">
</a>[/CLOAK]

5. Google Analytics Support

This joomla plugin works along with both versions of Google analytics Script Code(urchin and the newer GA tracker).
[CLOAK]<a id='url_amazon' 
href="http://www.amazon.com/bestsellers/ref=sv_sw_h__3&
affiliate_code=98280098" onclick="javascript:pageTracker._trackPageview
('/outgoing/www.amazon.com');"
>Amazon best seller </a>[/CLOAK]
[CLOAK statustext="http://www.amazon.com"]<a id='url_amazon' 
href="http://www.amazon.com/bestsellers/ref=sv_sw_h__3&
affiliate_code=98280098" onclick="javascript:pageTracker._trackPageview
('/outgoing/www.amazon.com');"
 class='links'> Amazon best seller </a>[/CLOAK]

If you have any doubts or ideas on how to improve this plugin further then please feel free to write me. I am available at tovishal2001@gmail.com. Hope you enjoyed it, thanks.