Connect with us

Affiliate Tracking

How To Setup Clickbank Postback Conversion Tracking For Any Affiliate Platform



Updated: 2020

Have you been wondering how to set up the Clickbank Postback?

Usually the first question we ask is How to make money with clickbank? But before that, you need to setup Clickbank Postback tracking so that you can easily track where your conversions are coming from.

There are a lot of solid offers in Clickbank that are whitehat and can be promoted on various traffic sources without any issues.  

The issue is that many trackers are not compatible with clickbank’s tracking and the conversions need to be exported then imported into your tracker to be able to track anything properly.  

Recently they made some changes and we did a video that shows specifically how to setup your Clickbank Postback. Click Affiliate Marketing Website Action Plan to watch the videos. The beow video talks specifically about Clickbank Postback.

Setting up tracking between different platforms can be a HUGE pain and very time consuming when it comes to affiliate marketing tracking.

The first and best thing to do is get Bemob or some other affiliate tracker that easily integrates with Clickbank postback feature.

You can control the funnel to optimize your traffic even further, but we will not focus on that. The point of this post is to get it working with any tracker even CPV LAB PRO for example.

A lot of affiliates are not aware of this but you can call the Clickbank Postback anytime you have a sale!

The main problem is the Clickbank postback cannot be configured and sent to all tracking systems the way you would like it to send.  It’s pretty much useless on some platforms. That being said with one little script we can configure it and make it work with any tracking system out there!

How to Setup Clickbank Postback With a Platform That Does NOT Integrate

You will need a few things before we get started.

  • Clickbank account
  • The postback URL from your tracker
  • The script (down below)
  • An SSL certificate (because clickbank will not send anything to a non secure URL)

Login to your clickbank account and click on my site in the top.

clickbank postback login

Scroll down until you see integrated sales reporting

integrated sales reporting

Click “add tracking code” button.  In the type box select “Tracking Pixel Order Confirmation (Receipt).  For the track as select the affiliate option.

The URL you are going to enter is where ever you decide to upload the script below too. (example: The file needs to be in php format, remember this.

Everything should like the picture below.

tracking pixel affiliate

Click on “Save” and you will be direct to a page like the one shown below.

saved tracking code conversion

As you can see the tracking pixel is inactive.  We can activate this later once we have setup the script. Create a file called script.php and copy the following code into that file.

// This script only reports initial sales and upsells.
// If you were using Funnel Flux instead, then rebills and refunds
// would also be tracked automatically as Funnel Flux is fully integrated with Clickbank.
// Instructions: You will edit the 4 parameters defined
// in the "SETTINGS TO EDIT" section below.
// 1/ Replace the value of $postbackURL by the postback URL given to you by
// your tracker BUT in that URL keep only the part that is before the ?
// 2/ Replace the value of $cidParameterName by the name of the click-id
// parameter (example: "cid" for Voluum)
// 3/ Replace the value of $payoutParameterName by the name of the parameter
// that allows you to track your commissions for a conversion (example: "payout" for Voluum)
// 4/ Replace the value of $transactionParameterName by the name of the parameter
// that allows you to track upsells (example: "txid" for Voluum)
// Only $postbackURL and $cidParameterName are mandatory.
// If you do not want or can't fill in the other two, then make them empty like this:
// $payoutParameterName = ""
// $transactionParameterName = ""
$postbackURL = "";
$cidParameterName = "cid";
$payoutParameterName = "payout";
$transactionParameterName = "txid";
$tid = filter_input(INPUT_GET, "trackingCodes");
$payout = filter_input(INPUT_GET, "affiliateCommission");
$txid = filter_input(INPUT_GET, "receipt");
$aParams = array();
if( $tid !== null && !empty($cidParameterName) )
$aParams[$cidParameterName] = $tid;
if( $payout !== null && !empty($payoutParameterName) )
$aParams[$payoutParameterName] = $payout;
if( $txid !== null && !empty($transactionParameterName) )
$aParams[$transactionParameterName] = $txid;
$aParts = explode("?", trim($postbackURL));
$finalPostbackURL = $aParts[0]."?".http_build_query($aParams);
if( $finalPostbackURL )
$ch = curl_init($finalPostbackURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

Then you will have to edit a few things in the Settings to Edit.

First thing you will change is the $postbackURL. You will get the postback URL from your tracker and paste it in it’s place between the quotes.  

If you are using another tracker you will need to change 3 more parts.

The line $cidParameterName = “cid”; Replace “cid” with the name of your postback click id parameter.  You will need to refer to your tracking guide documentation for this.

The line:

$payoutParameterName = “payout”;
Replace “payout” with the name of your postback payout parameter.  Again you may need to consult your documentation for your tracker.

The Line $transactionParameterName = “txid”; Replace “txid” with the name of your postback transaction id parameter -This helps you to track upsells if there are any. Please refer to your tracking documentation for more information.

Once this has been completed simply go back to clickbank and activate your tracking pixel and you are done!

tracking pixel

That is all that needs to be done, any questions please post them in our Affiliate forum.

I have been an online affiliate marketer since 2002. You can check out my free training at Free CPA Marketing Training



Leave a Reply

Your email address will not be published. Required fields are marked *