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

var key = window.location.href.split("go/")[1].replace("/","")
var urls={
 'fb':'', //Your Affiliate is or
 'product1':"Your Affiliate link",
 'product2':"Your Affiliate link",
 document.write("'"+key+"' not found :(");

go – Affiliate Link prefix (Cloak the URL)

  • Replace ‘fb’:’’, with product name and its Affiliate link

Example usage

'fb':'',   //Result -
  • FB – Link Name
  • – Destination URL
  • Result –

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

New row Example

var urls={
'product1':"Your Affiliate link",
'product2':"Your Affiliate link",
'product3':"Your Affiliate link", //new row
  • Your Normal Affiliate link –
  • Cloaking Affiliate link –
  • If your Domain having default Blogger Blog address means It Look like this
  • 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?

Your feedback helps us improve