How to cloak affiliate links in BlogSpot Blogging Platform


How to cloak affiliate links in BlogSpot Blogging Platform

In the past tutorial, we have shown you cloak affiliate links in WordPress without plugins in this tutorial we are going to see about cloak affiliate links in BlogSpot Blogging Platform.Wordpress have a lot of Features with third party plugin support like Url shortener plugin, Affiliate Cloaking etc.but blogger platform having limited features but nowadays Blogspot template developers change the word “Limited Feature in Blogger platform”  yes now they launch the lot of advanced feature like WordPress by using Javascript and jQuery.

In this tutorial part, we are going to see about cloaking the Affiliate URL in Blogspot Blogging Platform

Follow this Crucial method to cloak affiliate links in Blogger blog


  • Login to your blogger Dashboard
  • Go to Template > Edit HTML
  • Use CTRL + F to Find the </head> Tag
  • Now copy and paste the below Javascript code just above closed head tag

cloak affiliate links in BlogSpot

<script language='javascript'>

//Blogger Affiliate Link Shortener

//<![CDATA[
var key = window.location.href.split("go/")[1].replace("/","")
var urls={
 'fb':'https://www.facebook.com/mskian', //Your Affiliate is http://example.com/go/fb or http://example.blogspot.com/go/fb
 'product1':"Your Affiliate link",
 'product2':"Your Affiliate link",
}
if(key){
 if(urls[key]){
 window.location.href=urls[key]
 }else{
 document.write("'"+key+"' not found :(");
 }
}
//]]>
</script>

go – Affiliate Link prefix (Cloak the URL)

  • Replace ‘fb’:’https://www.facebook.com/mskian’, with product name and its Affiliate link

Example usage

'fb':'https://www.facebook.com/mskian',   //Result - http://example.com/go/fb
  • FB – Link Name
  • https://www.facebook.com/mskian – Destination URL
  • Result – http://example.com/go/fb

It supports Multiple URL Just add the new row just below the  ‘product2’:”Your Affiliate link” ,

New row Example

var urls={
'fb':'https://www.facebook.com/mskian',
'product1':"Your Affiliate link",
'product2':"Your Affiliate link",
'product3':"Your Affiliate link", //new row
  • Your Normal Affiliate link – http://affweb.com/id111
  • Cloaking Affiliate link – http://website.com/go/brandname
  • If your Domain having default Blogger Blog address means It Look like this http://santhoshveer.blogspot.in/go/brandname
  • Custom domain URL look like this – http://www.exampleblog/go/brandname
  • After all, settings click “Save template.”

How does it work?

  • Using Javascript Windows Location Method – refer
  • Using Javascript get URL Method – see

If you have Any Doubts in this Topic, Please Feel Free to Comment here.I will Help you.

 



Was this article helpful?
Thanks!

Your feedback helps us improve Allwebtuts.com