To get started, request your API ID and API Token. In all requests to the API, the ID and the Token must be provided. You can talk to your Account Manager about creating and obtaining your API Key. On the left menu you can check the details of the available methods.
Requirements:
No matter the method you want to call, the base URL is always the same (http://api.hangmytracking.com/api.php). Then you have to define the parameters of each request. The parameters required are method, apiToken and apiID. Then depending on the method you can apply filters to your query. In the example bellow, details about offer ID 42 are being requested. Finally just make a POST request and a json object with your response will be returned.
< ? php function httpPost($url,$params) { $postData = http_build_query($params); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); return $output; } $base_url = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getOffers' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'filters[idOffer]' => array('25156') ,'epc' => 1 ); $response = json_decode(httpPost($base_url,$parameters)); ?>
API responses are pretty straight forward, you get a json object with the status (OK or NOK), the number of errors and a description of each error. If there are no errors then the data will have the total of records returned and the details of all the records.
stdClass Object ( [status] => OK [data] => stdClass Object ( [total_records] => 1 [offers] => Array ( [0] => stdClass Object ( [id] => 25156 [name] => GB 2445 Incent/Android/Private/Direct/CPA/DT - PokerStars [conversion_type] => serverpostback [conv_default_status] => approved [allow_duplicates] => 0 [require_approval] => 1 [approved] => 1 [tracking_link] => https://tracking.hangmytracking.com/click.php?oid=25156&aid=aff_id&subid=YOUR_CLICK_ID&type=YOUR_SUB_SOURCE&google_aid=REPLACE_WITH_GAID&ios_ifa=REPLACE_WITH_IDFA [description] => Install, Register & Deposit. £20 free play when you first deposit £10 with code TWENTY. New Players only and 21+ yrs old. [conditions] => Requires Android 5.0 or higher. [daily_cap] => 50 [cap_timezone] => (GMT+00:00) [monthly_cap] => 500 [blocked_sources] => Array ( [0] => 123_abc [1] => 987_zxy ) [categories] => Incent, CPA, Direct, Android, Private, DT [categoriesID] => 6, 21, 17, 7, 16, 23 [countries] => GB [countries_name] => United Kingdom [start_date] => 2020-01-01 08:00:00 [expiration_date] => 2025-04-14 00:30:00 [status] => active [preview_URL] => https://play.google.com/store/apps/details?id=com.pokerstars.uk&gl=UK [payout_cents] => 5000 [pay_type] => CPA [pay_curr] => USD [thumbnail] => https://banners.hangmyads.com/files/uploads/Off_A_23074.png [epc] => 7.06 [package] => com.pokerstars.uk [categories_obj] => stdClass Object ( [6] => Incent [21] => CPA [17] => Direct [7] => Android [16] => Private [23] => DT ) [countries_obj] => stdClass Object ( [GB] => United Kingdom ) [goals] => Array ( [0] => stdClass Object ( [first deposit] => stdClass Object ( [pay_type] => CPA [pay_cents] => 5000 [pay_currency] => USD ) ) [1] => stdClass Object ( [completed_registration] => stdClass Object ( [pay_type] => CPA [pay_cents] => 0 [pay_currency] => USD ) ) ) ) ) ) [errors] => 0 [errorMessages] => Array ( ) )
getCategories
Get all the Category types available on the platform and their respective IDs. It's particulary helpfull to filter offers by category ID.
Name | Data Type | Description | Required |
---|---|---|---|
idCategory | Array of Integer | An array with the IDs of the categories you want. If empty all categories will be returned | No |
A categories object containing the category names requested.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getCategories' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'filters[idCategory]' => array(6,7,8) ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getConversionDetails
Get the details of the Conversions made between a range of dates.
Name | Data Type | Description | Required |
---|---|---|---|
start_date | Date Time | The start date of the range. Format is YYYY-MM-DD hh:mm:ss | Yes |
end_date | Date Time | The end date of the range. Format is YYYY-MM-DD hh:mm:ss | Yes |
offset | Integer | Timezone offset to GMT in MINUTES. For example, for Eastern US Timezone send -300 (-5hours*60minutes). | No |
fields | Array | An array with the fields wanted as the keys and "on" as value. Possible fields are offer_id, offer, affiliate_id, affiliate, ad_name, url_name, goal_name, conv_time, payout, currency, click_id, id, affiliate_source, affiliate_subid, affiliate_subid2, affiliate_subid2, affiliate_subid3, affiliate_subid4, affiliate_subid5, aff_custom, click_ip, is_duplicated, country_name, browser, device_type, device_brand, device_model, device_os, device_os_version, device_id, android_id, mac_address, ios_ifa, google_aid | Yes at least one |
filters | Array | An array of parameters where the Key should be the name of the field to filter by and the value the ID of the field. Possible keys of the array are offer_id and ad_id. | No |
limit | Integer | The number of items returned per page. | No |
page | Integer | Page by the limit of times returned. Defaults is the first page. | No |
sort | String | Sort by one of the fields allowed. | No |
sortby | String | If sort is used, ascending or descending can be choosen here by sending ASC or DESC in the sortby parameter. | No |
format | String | A string with the format of the response. At this moment, all results will be in json so this parameter can be ignored. | No |
An array of Conversion objects containing the conversion fields requested.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getConversionDetails' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'offset' => -8*60 ,'sort' => 'conv_time' ,'sortby' => 'desc' ,'limit' => 10 ,'page' => 2 ,'format' => 'json' ,'start_date' => '2015-01-08 08:00:00' ,'end_date' => '2015-01-08 21:00:00' ,'filters[offer_id]' => array(182) ,'fields[conv_time]' => 'on' ,'fields[affiliate_subid]' => 'on' ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getOffers
Find offers and get details on them.
Name | Data Type | Description | Required | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
filters | Array |
|
No | ||||||||
epc | Integer | 1 if you wish to receive the current campaign EPC 0 if it's not required | No | ||||||||
limit | Integer | The number of items returned per page. | No | ||||||||
page | Integer | Page by the limit of times returned. Defaults is the first page. | No | ||||||||
sort | String | Sort by one of the fields allowed. | No | ||||||||
sortby | String | If sort is used, ascending or descending can be choosen here by sending ASC or DESC in the sortby parameter. | No | ||||||||
format | String | A string with the format of the response. At this moment, all results will be in json so this parameter can be ignored. | No |
An array of Offer objects containing the offer details.
You can check the home page for a sample response of getOffers call
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getOffers' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'sort' => 'start_date' ,'sortby' => 'desc' ,'limit' => 25 ,'page' => 1 ,'format' => 'json' ,'filters[country]' => array('GB','IN') ,'filters[category]' => array(7,8) ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getOfferStatus
Get details of the reason for status of an offer, like if it's paused due to reaching the cap and it will come back.
Name | Data Type | Description | Required |
---|---|---|---|
offerID | Integer | The ID of the Offer which more details of its status is being requested. | Yes |
An objects with the details of the status of the offer.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getOfferStatus' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'offerID' => 19517 ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getOfferAds
Get Ad details from one or more offers.
Name | Data Type | Description | Required |
---|---|---|---|
filters | Array | An array of parameters where the Key should be the name of the field to filter by. Most fields can be used but only n_idOffer is mandatory. | Yes, an offer ID is required in the n_idOffer filter parameter |
An array of Ads objects containing the ad details.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getOfferAds' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'filters[n_idOffer]' => array(197,198) ,'filters[n_idAd_type]' => array(1) ,'filters[width]' => array(300) ,'filters[height]' => array(250) ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getOfferURLs
Get URL details from one or more offers. URL named default is already specified in the offer details but it's possible to have more than one landing page in the offer.
Name | Data Type | Description | Required |
---|---|---|---|
filters | Array | An array of parameters where the Key should be the name of the field to filter by. | Yes, an offer ID is required in the n_idOffer filter parameter |
An array of URL objects containing the URL details.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getOfferURLs' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'filters[n_idOffer]' => array(160,161,162) ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getOfferTargeting
Get Target details from one or more offers.
Name | Data Type | Description | Required |
---|---|---|---|
filters | Array | An array of parameters where the Key should be the name of the field to filter by. Only n_idOffer filter is required but it can also be filtered by type of target and action. | Yes, an offer ID is required in the n_idOffer filter parameter |
An array of Target objects containing the target details.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getOfferTargeting' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'filters[n_idOffer]' => array(23,156,162,172) ,'filters[type]' => array('Geo') ,'filters[action]' => array('Allow') ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getFinancialReport
Get a detailed Financial report of the offers.
Name | Data Type | Description | Required |
---|---|---|---|
start_date | Date | The start date of the range. Format is YYYY-MM-DD | Yes |
end_date | Date | The end date of the range. Format is YYYY-MM-DD. The difference between start and end date to be bigger than 3 days. | Yes |
offset | Integer | Timezone offset to GMT in MINUTES. For example, for Eastern US Timezone send -480 (-8hours*60minutes). | No |
fields | Array | An array with the fields wanted as the keys and "on" as value. Possible fields are offer_id, offer, publisher, zero_rev, rev_type, rev_cents, year, month, week, day, revenue, rpa, installs, currency, storeid | Yes at least one |
filters | Array | An array of parameters where the Key should be the name of the field to filter by and the value the ID of the field. There is only one possible key of the array here and it's offer_id. | No |
limit | Integer | The number of items returned per page. | No |
page | Integer | Page by the limit of times returned. Defaults is the first page. | No |
sort | String | Sort by one of the fields requested but it has to be requested. | No |
sortby | String | If sort is used, ascending or descending can be choosen here by sending ASC or DESC in the sortby parameter. | No |
format | String | A string with the format of the response. At this moment, all results will be in json so this parameter can be ignored. | No |
An array of Stats objects containing the stats report requested.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getFinancialReport' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'offset' => 60 ,'limit' => 10 ,'page' => 1 ,'format' => 'json' ,'sort' => 'payout' ,'sortby' => 'desc' ,'start_date' => '2021-01-01' ,'end_date' => '2021-01-05' ,'fields[offer]' => 'on' ,'fields[installs]' => 'on' ,'fields[publisher]' => 'on' ,'fields[revenue]' => 'on' ,'fields[day]' => 'on' ,'fields[storeid]' => 'on' ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getPrintsReport
Get an Ad Tag report that includes impressions count, CVR, eCPM, etc.
Name | Data Type | Description | Required |
---|---|---|---|
start_date | Date | The start date of the range. Format is YYYY-MM-DD | Yes |
end_date | Date | The end date of the range. Format is YYYY-MM-DD | Yes |
fields | Array | An array with the fields wanted as the keys and "on" as value. Possible fields are impressions, cpm, click_unique, ctr, installs, cr, payout | Yes at least one |
filters | Array | An array of parameters where the Key should be the name of the field to filter by and the value the ID of the field. Possible keys of the array are offer_id and creative_id. | No |
limit | Integer | The number of items returned per page. | No |
page | Integer | Page by the limit of times returned. Defaults is the first page. | No |
sort | String | Sort by one of the fields requested but it has to be requested. | No |
sortby | String | If sort is used, ascending or descending can be choosen here by sending ASC or DESC in the sortby parameter. | No |
format | String | A string with the format of the response. At this moment, all results will be in json so this parameter can be ignored. | No |
An array of Stats objects containing the stats report requested.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getPrintsReport' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'format' => 'json' ,'sort' => 'payout' ,'sortby' => 'desc' ,'fields[impressions]' => 'on' ,'fields[click_unique]' => 'on' ,'fields[ctr]' => 'on' ,'fields[installs]' => 'on' ,'fields[cr]' => 'on' ,'fields[payout]' => 'on' ,'start_date' => date('Y-m-d', strtotime('-2 days')) ,'end_date' => date('Y-m-d') ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
getTrackingLink
Get the Tracking Link from available offers. If the offer requires approval, a access request has to be made first.
Name | Data Type | Description | Required |
---|---|---|---|
offerID | Integer | The ID of the Offer for which the tracking link is requested. | Yes |
urlID | Integer | To redirect to a diferent landing page send the ID of the URL in the offer. If a 50/50 random test is wanted, send random in this parameter. | No |
adID | Integer | To track a specific ad send the ID of the ad in the offer. | No |
The affiliate tracking link for the offer.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'getTrackingLink' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'offerID' => 23 ,'urlID' => 'random' ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>
requestOfferAccess
Request access to an offer.
Name | Data Type | Description | Required |
---|---|---|---|
offerID | Integer | The ID of the offer for which access is being requested. | Yes |
Hang My Tracking response to the offer access request.
< ? php $baseURL = 'http://api.hangmytracking.com/api.php'; $parameters = array( 'method' => 'requestOfferAccess' ,'apiToken' => API_KEY ,'apiID' => NETWORK_ID ,'offerID' => 79 ); $postData = http_build_query($parameters); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$baseURL); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, count($postData)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); $response = json_decode($output); ?>