Home
Fractals
Tutorials
Books
My blog
My LinkedIn Profile

BOOKS i'm reading

Napoleon Hill Keys to Success: The 17 Principles of Personal Achievement, Napoleon Hill, ISBN: 978-0452272811
The 4-Hour Workweek: Escape 9-5, Live Anywhere, and Join the New Rich (Expanded and Updated), Timothy Ferriss, ISBN: 978-0307465351
The Fountainhead, Ayn Rand, ISBN: 0452273331

Javascript code to extract cbf parameter from location url and modify payment links to include the extracted cbf parameter

Olivier Langlois, IT superstar coach, Dominate LinkedIn Formula author
by Olivier Langlois

Contents





Introduction

When you create an upsell flow for Clickbank, you will find a small checkbox 'I will be passing the cbf parameter'. Since Clickbank one click purchase system that is so powerful is relying on cookies, if a visitor has disabled the cookies make a purchase while he is in your PitchPlus upsell flow, he will be returned into the order page where he will need to reenter his credit card information. This is an unnecessary step where the customer has another opportunity to change his mind and not complete the purchase. As a digital marketer, this is the type of unnecessary steps that we have to remove in order to optimize income.

This is where the cbf parameter thing comes in. It is a way for Clickbank to workaround problems when visitors have their cookies disabled (Clickbank estimations are about 10% of traffic have cookies desactivated). So it pass a PitchPlus flow session identifier (cbf) to your server by passing it as a url parameter and your task is to pass it back to Clickbank by modifying the page payment links.

IMHO, the easiest way to achieve that is through Javascript. It is pretty trivial to implement. It took me about 15 minutes to implement it but it could have been much faster if I did found an example on the Internet. There was none so I thought it would be a good idea to fill that gap, help others (and get some income from ads...)

Using the code

It is very simple. Here are the steps:

  1. Include jQuery
  2. Copy & paste the code below
  3. Change your payment links tags to be in the paylink CSS class

Note that it could be trivial to modify the code for someone determined to not use jQuery but I'll leave that as an exercise to my most motivated readers...

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script type="text/javascript">
function gup( name, url ) {
      if (!url) url = location.href;
      name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
      var regexS = "[\\?&]"+name+"=([^&#]*)";
      var regex = new RegExp( regexS );
      var results = regex.exec( url );
      return results == null ? null : results[1];
    }

jQuery(function($) {
	result = gup('cbf', null );
	if (result) {
		$('.paylink').each(function(i,obj) {
			obj.href += "&cbf=" + result;
		});
	}
});
</script>

As a little but useful sidenote, note that the code should ideally be placed just before you close the <body> tag. That way, it will make your page load faster...

Finally, you have to go through all your payment link on your page and change the following

<a id="accept1" href="http://2.juicingoli.pay.clickbank.net/?cbur=a">

to

<a class="paylink" id="accept1" href="http://2.juicingoli.pay.clickbank.net/?cbur=a">

An example

One way to test it, it to go to my front-end product page and buy all my products.

Conclusion

I hope this has been helpful to you. There are several things you can do to thank me. The best way would be to buy my stuff and in case you don't need my wonderful products right now in your life that would be greatly appreciated if you take few seconds to tweet, like and share this article by using the social media buttons found on this page.

History

  • 06-10-2016:
    • Original article.


Back to the tutorials list

Home :: Fractals :: Tutorials :: Books :: My blog :: My LinkedIn Profile :: Contact