Conversion Api for referral code based tracking

You can directly integrate the referral code based conversion tracking in your application using the “Conversion API“. It will return response whether the referral was valid. You can learn more about referral code based tracking here. The API and response are explained below.


Select All


<?php 
$bid = '52X'; 
$secretKey = '7ABZC3XXXXXXXXXXXXX'; 
$campaignID = '';
$email = ''; //set user email
$orderID = ''; //set order id
$referrerCode = ''; 
$http_val = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://';
$result = file_get_contents($http_val.'www.ref-r.com/campaign/t1/conversion?secretKey='.$secretKey.'&bid='.$bid.'&campaignID='.$campaignID.'&email='.$email.'&orderID='.$orderID.'&referrerCode='.$referrerCode);
print_r($result);
?>

Parameter Description Value
secretKey *
(string)
secret key for authentication 3B8DXXXXXXXXXXXXXXXXXXXXXXX
bid *
(string)
unique brand id 52X
campaignID *
(string)
campaign id of the running campaign 10XX
referrerCode *
(string)
referral code given by the referrer to his friend to make sale so that he gets the incentive MARXXX
orderID *
(string)
order id of the customer ABXHXXXXX
email
(string)
customer's email id example@gmail.com
mobile
(string)
customer's mobile number 9717XXXXXX
purchaseValue
(string)
total purchase value of the order 10000

Json Response

response message Description
success conversion successful you get an array of conversion details (conversion_details), which is defined below

conversion_details (array)

Parameter Description Value
referrer_name name of the referrer (who referred his friend) Robert Downy
referrer_email email id of the referrer example@gmail.com
referee_name name of the referee (friend) Cristian Bale
referee_email email id of the referee example@gmail.com
orderID orderID passed by you in javascript code ASDXXXXX
purchaseValue purchaseValue passed by you in javascript code 1000
fail no conversion there is no conversion
fail Access Denied Authentication failed. Invalid secret key or brand id.
fail Account Inactive Account expired. Need to upgrade to an appropriate plan.
fail Parameters missing Pass all compulsory parameters as defined above.