Sign Up For An Account


Forgot Passwod?
Login

Subscribe

 
Knowledgebase
General (6)
Supplier (13)
Buyers (1)
FAQs (2)
Knowledgebase: Advertisers
ClickBetter CPA API: Set Up Tracking For Your CPA Campaign
Posted by John D on 16 June 2015 08:01 AM

Set Up Tracking For Your CPA Campaign

 

Once you have created your campaign, now it's time to set up tracking for it so affiliates can be paid for their efforts.

 

Setting Up Your Tracking Code

 

On your thank you page or on the page where your desired CPA action is completed, you have to set up this tracking code so when it’s executed, ClickBetter.com can generate the CPA sale for the associated affiliate and he gets paid the amount you have set as your campaign amount.

 

Tracking Code

 

There are six types of tracking code:

 

1. Pixel Tracking Code For API Version 1

 

2. HTTP POST Tracking Code For API Version 1

 

3. Pixel Tracking Code For API Version 2

 

4. HTTP POST Tracking Code For API Version 2

 

5. HTTP GET Tracking Code For API Version 1

 

6. HTTP GET Tracking Code For API Version 2

 

 

Pixel Tracking Code For API Version 1

 

While setting up your campaign you can set version of API to be used for its tracking. The below described pixel code is for API version 1.

 

In this type of tracking, you have to put a pixel on your thank you or action completion page. A pixel is nothing but a 1x1 white image.

 

Code:

 

<img src="https://clickbetter.com/vip.gif?campid=[CAMPID]&fname=[FNAME]&lname=[LNAME]&cemail=[BUYEREMAIL]&phone=[PHONE]&address=[STREET]&city=[CITY]&state=[STATE]&country=[COUNTRY]&vendortid=[VENDORTID]">

 

where

 

[CAMPID]: 3 digit ClickBetter CAMPAIGN ID (Required)

 

[FNAME]: First Name of The Buyer (Optional)

 

[LNAME]: Last Name of The Buyer (Optional)

 

[BUYEREMAIL]: Buyer’s Email (Optional)

 

[PHONE]: Buyer’s Phone (Optional)

 

[STREET]: Buyer’s Stree/1st Line of Address (Optional)

 

[CITY]: Buyer’s City (Optional)

 

[STATE]: Buyer’s State (Optional)

 

[COUNTRY]: Buyer’s Country (Optional)

 

[VENDORTID]: A STRING YOU CAN PASS TO TRACK SALE (Optional)

 

It is very important that your URL encodes these variables. Otherwise, these won't be passed properly over to the ClickBetter API. Also, as you can see only "campid" parameter is required/mandatory. All other parameters are optional and whether you send them for a sale or not is your choice.

 

We have also integrated an Intelligent IP Security feature to protect you from any potential affiliate fraud. It is mandatory that you use this for Pixel Tracking. Simply edit your campaign and set the correct server IP address of the Goal/Thank You/Action Completion Page (where you installed your pixel tracking code).

 

Try our online tracking code generator from your campaigns list page.

 

HTTP POST Tracking Code For API Version 1

 

In this method, you can send the sale parameters such as campid, buyeremail, fname, lname, etc. using HTTP POST method to our API URL.

 

You might notice that in the pixel method for API version 1, you need not send "affiliate" parameter, which is automatically stored in a COOKIE, plus a "secretkey" parameter as the security is taken care by the IP feature. However in this method, you have to send an "affiliate" parameter which is nothing but the ClickBetter username of the affiliate to which you wish to credit the CPA sale and the "secretkey" parameter which is a strong password like string only known to you and can be set up while setting up or editing your ClickBetter CPA campaign.

 

API URL: https://clickbetter.com/vipaddapi.php

 

Parameters:

 

"campid": This required parameter should be campaign ID of your campaign.

 

"secretkey": This required parameter should be the secret key for this campaign

 

"affiliate": This required parameter should be the affiliate ID

 

(click here to know how to get affiliate ID from the affiliate traffic)

 

"fname": Buyer's first name (optional)

 

"lname": Buyer's last name (optional)

 

"cemail": Buyer's email (optional)

 

"phone": Buyer's phone (optional)

 

"address": Buyer's address line 1 OR street (optional)

 

"city": Buyer's City (optional)

 

"state": Buyer's State (optional)

 

"country": Buyer's Country (optional)

 

"vendortid": Any string which you can pass to track the CPA sale at your end

 

Try our online tracking code generator from your campaigns list page.

 

Pixel Tracking Code For API Version 2

 

This method is same as API version 1 with the one change. If your campaign uses this API version 2, you have to send "clickid" instead of "campid" parameter. Also, this version allows you to track sales even after the COOKIE is expired and affiliate is lost because the "clickid" automatically stores the affiliate information on our servers. This method is preferred by the vendors where the time difference between click on affiliate link and action completed can be very long.

 

Click here to know how to get "clickid" from affiliate traffic.

 

Code:

 

<img src="https://clickbetter.com/vip.gif?clickid=[CLICKID]&fname=[FNAME]&lname=[LNAME]&cemail=[BUYEREMAIL]&phone=[PHONE]&address=[STREET]&city=[CITY]&state=[STATE]&country=[COUNTRY]&vendortid=[VENDORTID]">

 

where

 

[CLICKID]: Unique Clickid Genearted Per Affiliate Link Click (Required)

 

[FNAME]: First Name of The Buyer (Optional)

 

[LNAME]: Last Name of The Buyer (Optional)

 

[BUYEREMAIL]: Buyer’s Email (Optional)

 

[PHONE]: Buyer’s Phone (Optional)

 

[STREET]: Buyer’s Stree/1st Line of Address (Optional)

 

[CITY]: Buyer’s City (Optional)

 

[STATE]: Buyer’s State (Optional)

 

[COUNTRY]: Buyer’s Country (Optional)

 

[VENDORTID]: A STRING YOU CAN PASS TO TRACK SALE (Optional)

 

It is very important that your URL encodes these variables. Otherwise these won't be passed properly over to the ClickBetter API.

 

Note that only the "clickid" parameter is required/mandatory. All other parameters are optional and whether you send them for a sale or not, its your choice.

 

We have also integrated an Intelligent IP Security feature to protect you from any potential affiliate fraud. It is mandatory that you use this for Pixel Tracking. Simply edit your campaign and set the correct server IP address of the Goal/Thank You/Action Completion Page (where you installed your pixel tracking code).

 

Try our online tracking code generator from your campaigns list page.

 

 

HTTP POST Tracking Code For API Version 2

 

This is same as HTTP POST tracking for API version 1, except a single change - "clickid" instead of "campid". You do not need to send the "affiliate" variable as it’s stored on our server with clickid info.

 

Click here to know how to get "clickid" from affiliate traffic.

 

API URL: https://clickbetter.com/vipaddapi.php

 

Parameters:

 

"clickid": This required parameter should be click ID of the affiliate link click.

 

"secretkey": This required parameter should be the secret key for this campaign

 

"fname": Buyer's first name (optional)

 

"lname": Buyer's last name (optional)

 

"cemail": Buyer's email (optional)

 

"phone": Buyer's phone (optional)

 

"address": Buyer's address line 1 OR street (optional)

 

"city": Buyer's City (optional)

 

"state": Buyer's State (optional)

 

"country": Buyer's Country (optional)

 

"vendortid": Any string which you can pass to track the CPA sale at your end

 

Try our online tracking code generator from your campaigns list page.

 

HTTP GET Tracking Code For API Version 1

 

In this method, you can send the sale parameters such as campid, buyeremail, fname, lname, etc. using HTTP GET method to our API URL.

 

You might notice that in the pixel method for API version 1, you need not send "affiliate" parameter, which is automatically stored in a COOKIE, plus a "secretkey" parameter as the security is taken care by the IP feature. However in this method, you have to send an "affiliate" parameter which is nothing but the ClickBetter username of the affiliate to which you wish to credit the CPA sale and the "secretkey" parameter which is a strong password like string only known to you and can be set up while setting up or editing your ClickBetter CPA campaign.

 

API URL:

 

https://clickbetter.com/vipaddapinew.php?campid=[campid]&secretkey=[secretkey]&affiliate=[affiliate]&fname=[fname]&lname=[lname]&cemail=[cemail]&phone=[phone]&address=[address]&city=[city]&state=[state]&country=[country]&vendortid=[vendortid]

 

Parameters:

 

"campid": This required parameter should be campaign ID of your campaign.

 

"secretkey": This required parameter should be the secret key for this campaign

 

"affiliate": This required parameter should be the affiliate ID

 

(click here to know how to get affiliate ID from the affiliate traffic)

 

"fname": Buyer's first name (optional)

 

"lname": Buyer's last name (optional)

 

"cemail": Buyer's email (optional)

 

"phone": Buyer's phone (optional)

 

"address": Buyer's address line 1 OR street (optional)

 

"city": Buyer's City (optional)

 

"state": Buyer's State (optional)

 

"country": Buyer's Country (optional)

 

"vendortid": Any string which you can pass to track the CPA sale at your end

 

It is very important that your URL encodes these variables. Otherwise, these won't be passed properly over to the ClickBetter API.

 

Try our online tracking code generator from your campaigns list page.

 

HTTP GET Tracking Code For API Version 2

 

Again same as HTTP GET tracking for API version one except a single difference that here you send "clickid" instead of "campid". Also here you do not need to send "affiliate" as its stored on our server with clickid info.

 

Click here to know how to get "clickid" from affiliate traffic.

 

API URL:

 

https://clickbetter.com/vipaddapinew.php?clickid=[clickid]&secretkey=[secretkey]&fname=[fname]&lname=[lname]&cemail=[cemail]&phone=[phone]&address=[address]&city=[city]&state=[state]&country=[country]&vendortid=[vendortid]

 

Parameters:

 

"clickid": This required parameter should be click ID of the affiliate link click.

 

"secretkey": This required parameter should be the secret key for this campaign

 

"fname": Buyer's first name (optional)

 

"lname": Buyer's last name (optional)

 

"cemail": Buyer's email (optional)

 

"phone": Buyer's phone (optional)

 

"address": Buyer's address line 1 OR street (optional)

 

"city": Buyer's City (optional)

 

"state": Buyer's State (optional)

 

"country": Buyer's Country (optional)

 

"vendortid": Any string which you can pass to track the CPA sale at your end

 

It is very important that your URL encodes these variables. Otherwise, these won't be passed properly over to the ClickBetter API.

 

Try our online tracking code generator from your campaigns list page.