Knowledge Base         


How do I track sales using Postback URLs?


If you don’t have the ability to add the tracking pixels or the Conversion Tracking Code to the “Thank You” page users land on after making a purchase, then you’ll need to use Postback URLs to track your sales.

A “Postback” is simply an automated notification that your affiliate network (such as ClickBank or MaxBounty) sends to ClickMagick whenever someone clicks your affiliate link and makes a purchase. This allows ClickMagick to record the sale, as well as any upsells, downsells and refunds, so it’s a more accurate way of tracking conversions if you’re willing to put in the work to set it up.
 


The process to set up a Postback URL with Campaigns is really simply if you just follow these steps provided. 
 
 
Note: Setting up a Postback URL with ClickBank is a bit different than for other networks. If you want to learn how to set up a Postback URL with ClickBank, take a look at this article and select the “ClickBank” tab:

How do I track sales with my affiliate network?





Step 1 – Include the cmc.js Code on Any Page That Uses Affiliate Links

If you already have the Click Tracking Code or the Conversion Tracking Code on all the pages where you use affiliate links, there’s nothing else to do.

Otherwise, add the line below to any pages where you need to use the [cmc_vid] token that don’t already have the Click Tracking Code or Conversion Tracking Code, preferably in the <head> section:

<script src='//cdn.clkmc.com/cmc.js'></script>

 


With the code in place, whenever the page is loaded all of the [cmc_vid] tokens you used in your affiliate links will automatically be replaced with a unique visitor ID for tracking purposes.

 
Note: Usually, adding that one line to your page is all you’ll need to do. However, there are two cases that will come up for web developers who create their own pages using advanced programming techniques. You can read about those below ...



Step 2 – Add a Visitor ID to Your Affiliate Link

  



The first step is to pass a visitor ID generated by ClickMagick to your affiliate network via your affiliate link.

The same process works for any affiliate network, but we will use MaxBounty for this example.
 
1.    Go to the Postback URL Builder tool and select “Campaigns” and “MaxBounty” from the dropdown options.

  

  
2.    Copy your MaxBounty affiliate link and paste it in the affiliate link generator. Then click the “Generate New Affiliate Link” button.
 
 
 
 
3.    Copy your modified link and replace your existing affiliate links with this new modified link.

 

  
This doesn’t change how your affiliate link works in any way, it simply sends some additional information to your affiliate network that allows ClickMagick to track your Campaign sales.


Step 3 – Add Your Postback URL to Your Affiliate Account



The next step is to copy your custom ClickMagick Postback URL from the green box at the bottom of the Postback URL Builder.

 


Everyone’s URL will be different, so take the one that you see listed in your account and paste it inside of your affiliate network, or MaxBounty in our example.

Every affiliate network is a bit different in terms of how and where you add your Postback URL, but with MaxBounty you would add it one time on your Profile page and it will be used for all your offers:

 


With other networks you may need to add the Postback URL to each specific offer.

If you have the choice of adding the Postback URL once in a global setting, we strongly recommend that so you can set it once and forget about it.

Also, when you add your Postback URL you may have to select a “type” to go with it (as shown in the MaxBounty example). Each affiliate network is a bit different, but always choose the option that says something like URL, Postback URL, etc. and never select pixel, iframe, HTML, etc.

If you can’t figure out where to add your Postback URL in your affiliate account to track your Campaign sales, just ask your affiliate manager or contact their customer support and they can tell you.


Replacing [cmc_vid] tokens in Non-URL Attributes

By default, the cmc.js script will replace tokens in the href="..."src="..." and value="..." attributes of HTML elements.

If you need to use a [cmc_vid] token in another type of attribute, you can add the attribute type to the existing list of attributes by including a special attrs property in a clickmagick_cmc object.

For example, if you had a special data-url="..." attribute, you could add that to the list by including this piece of code before you load the cmc.js script:

<script>
   var clickmagick_cmc = {
      attrs: ['data-url'],
   }
</script>
<script src='//cdn.clkmc.com/cmc.js'></script>


If you needed to add more than one attribute type, just separate each one with a comma:

attrs: ['data-url', 'placeholder', ...],

If you already have an existing clickmagick_cmc object on the page because you’re tracking a Campaign click or conversion, simply add the attrs line anywhere in the existing object. Just be sure to include that final comma on the end of the line.
 

Adding the [cmc_vid] value to JavaScript code

In other cases, you might need to use the [cmc_vid] value in your own JavaScript code.

In this scenario, if you don’t already have a clickmagick_cmc object on your page, add one with an empty vid field before you load the cmc.js file, like this:

<script>
   var clickmagick_cmc = {
      vid: '',
   }
</script>
<script src='//cdn.clkmc.com/cmc.js'></script>


If the script sees an vid field, it will fill it in with the unique ID which you can then use. For example:

var url = 'https://affiliatenetwork.com?s2=' + clickmagick_cmc.vid;

For the vid property to be initialized, you need to load the cmc.js file before executing your own JavaScript code.



Setting up a Postback URL with tracking links is just as simple as with Campaigns, main difference being the token used for the visitor ID. See the steps below to learn how to set up a Postback URL with your tracking links.
 
 
Note: Setting up a Postback URL with ClickBank is a bit different than for other networks. If you want to learn how to set up a Postback URL with ClickBank, take a look at this article and select the “ClickBank” tab:

How do I track sales with my affiliate network?





Step 1 – Add a Click ID to Your Affiliate Link



The first step is to pass a click ID generated by ClickMagick to your affiliate network via your affiliate link.

The same process works for any affiliate network, but we will use MaxBounty for this example.
 
1.    Go to the Postback URL Builder tool, and select “Tracking Links” and “MaxBounty” from the dropdown options.

  
 
 
2.    Copy your MaxBounty affiliate link and paste it in the affiliate link generator. Then click the “Generate New Affiliate Link” button.

  
 
 
3.    Copy your modified link and use it for the “Primary URL” of one or more tracking links.

 


This doesn’t change how your affiliate link works in any way, it simply sends some additional information to your affiliate network that allows ClickMagick to track your sales.

 
Step 2 – Add Your Postback URL to your Affiliate Account



The next step is to copy your custom ClickMagick Postback URL from the green box at the bottom of the Postback URL Builder.

 


Everyone’s URL will be different, so take the one that you see listed in your account and paste it inside of your affiliate network, or MaxBounty in our example.

Every affiliate network is a bit different in terms of how and where you add your Postback URL, but with MaxBounty you would add it one time on your Profile page and it will be used for all your offers:

 


With other networks you may need to add the Postback URL to each specific offer.

If you have the choice of adding the Postback URL once in a global setting, we strongly recommend that so you can set it once and forget about it.

Also, when you add your Postback URL you may have to select a “type” to go with it (as shown in the MaxBounty example). Each affiliate network is a bit different, but always choose the option that says something like URL, Postback URL, etc. and never select pixel, iframe, HTML, etc.

If you can’t figure out where to add your Postback URL in your affiliate account to track your sales, just ask your affiliate manager or contact their customer support and they can tell you.


Troubleshooting Your Postback URL

If you’re having trouble with your Postback URL, we built the Postback Debugger just for you. You’ll find it in the Tools menu and it has tools and information to help you figure out your problem.

If you have any questions, please submit a ticket at our Help desk with all the relevant details and we’ll be happy to take a look. Be sure to explain exactly what you’ve done based on the steps of this tutorial (with screenshots if possible) and what’s not working as expected.

Remember – the more details you provide, the better we’ll be able to help you!


Article 119 Last updated: 07/07/2020 12:41:10 PM
https://www.clickmagick.com/kb/?article=119