Affiliate Link Cloaker snippet for MODX Evolution
Contributors: iusemodx, breezer
![cloaklink] (https://raw.githubusercontent.com/Nicola1971/training-materials/master/Images/cloak/cloak-links-affiliate-modx-snippet.jpg)
Encode urls in base64 and redirect through a blocked page/folder
credits: http://ctrtard.com/affiliate-marketing/better-affiliate-link-cloaking-for-seo/
- create a new resource with the name of your choice
- add
[[CloakLinksRedirect]]
snippet call - This page must be noindex-nofollow in the robots metatags and/or "Disallow" in the robot.txt
[!CloakLinks? &landing=`49` &textlink=`site preview` &LinkTv=`AffiliateLink`!]
[!CloakLinks? &landing=`49` &textlink=`site preview` &LinkWeb=`http://modx.com/`!]
[!CloakLinks? &landing=`49` &urlparam=`visit` &textlink=`site preview` &LinkTv=`AffiliateLink`!]
[!CloakLinksRedirect? &urlparam=`visit`!]
- &textlink = text placeholder | default value: "Go to the website"
- &targetlink = href target attribute | default value: "_blank"
- &landing = resource id of the landing page for redirect (must contain a
[[CloakLinksRedirect]]
snippet call) - &LinkTv = (method 1) name of the Text template variable containing the affiliate link
- &LinkWeb = (method 2) full affiliate link
- &urlparam = custom parameter url | default value: "goto"
- &ErrorEmptyLink = text placeholder for empty tv and/or missing linkweb parameter | default value: "Empty Link"
- &textlink = text placeholder | default value: "Go to the website"
- &AffiliateSuffix = link suffix for affiliate code (ie: 123456789 or
[*affiliatecodetv*]
) - &urlparam = custom parameter url | default value: "goto"
- &linkelements = allows the addition of extras like class, title etc.
- &dummyparams = "Dummy" parameters e.g. ```&dummyparams=`pid=147&alias=cloaklinks&````
#More infos and demo http://www.tattoocms.it/extras/snippets/cloaklinks.html