API interface

The filter and tracker APIs allow you to work with visit checking, traffic and statistics. To get an API token, go to your profile page in the system. Interaction with the service is carried out via the HTTP protocol, the response status is always 200. The standard request format is GET or "pure" POST (form-urlencoded). When submitting in JSON, don't forget the Content-type: application/json header. The result format is JSON. There is no limit on the number of requests.

Futher in the text, important parameters are shown in curly brackets:

Important! When using links and data, don't use curly braces, only the values themselves!

Contents

Filtering

Filtering functions allow you to check visits to your sites as quickly as possible. They are placed in a separate interface, which has the minimum response time and maximum performance.

Check the visit

URL: https://www.altercpa.one/fltr/{user}-{key}-{id}

In the function address, instead of {user} and {key}, specify the API ID and key from the profile, instead of {id} specify the identifier of the filter site you added. You can get the specific URL by clicking on the "Manual" button of the corresponding site in your your personal account.

To check your visit, you need to send a POST request to the above URL. Pass the fields of your array $_SERVER as the body of the request - we will parse them and show the response in JSON format. A successful response includes the status, action and url fields. The status field always contains the value ok. The action field of the response will contain allow or deny depending on the verification results, the url field will contain the corresponding URL. In the error response, the status field will contain error, the error code will be indicated in the error field.

The POST part of the request must be in x-www-form-urlencoded format, JSON format is not supported. We parse the following fields from the $_SERVER array:

HTTP_USER_AGENT, HTTP_ACCEPT, HTTP_ACCEPT_CHARSET, HTTP_ACCEPT_ENCODING, HTTP_ACCEPT_LANGUAGE, HTTP_AUTHORIZATION, HTTP_CACHE_CONTROL, HTTP_CONNECTION, HTTP_CONTENT_DISPOSITION, HTTP_DATE, HTTP_EXPECT, HTTP_FROM, HTTP_HOST, HTTP_IF_MATCH, HTTP_IF_MODIFIED_SINCE, HTTP_IF_NONE_MATCH, HTTP_IF_RANGE, HTTP_IF_UNMODIFIED_SINCE, HTTP_MAX_FORWARDS, HTTP_PRAGMA, HTTP_PROXY_AUTHORIZATION, HTTP_RANGE, HTTP_REFERER, HTTP_TE, HTTP_TRAILER, HTTP_TRANSFER_ENCODING, HTTP_UPGRADE, HTTP_VIA, HTTP_X_FORWARDED_FOR, REMOTE_ADDR, REMOTE_PORT, REQUEST_METHOD, REQUEST_URI, QUERY_STRING, HTTP_CF_CONNECTING_IP, HTTP_CLIENT_IP, HTTP_X_REAL_IP, HTTP_X_PURPOSE, HTTP_X_FB_HTTP_ENGINE

The result of executing the function is an associative array:

Field Description
status The result of the operation: ok in case of successful execution, error in case of an error
action Action required based on verification results:
  • allow - legitimate visit, show target site
  • deny - suspicious visit, show dummy site
result The real result of testing traffic, which does not depend on the enabled training mode:
  • allow - legitimate visit, show target site
  • deny - suspicious visit, show dummy site
In training mode, the value of result may differ from the value of action.
url The site URL for the request depends on the results of the check.
target The URL of the target site, if available, is always shown regardless of the check results.
dummy The URL of the dummy site, if available, is always shown regardless of the check results.
error Error ID: access-denied if there is no access to the verification system, bad-request if the verification URL is incorrectly specified, bad-site if specified site not found.

An example of the implementation of sending a request:

$curl = curl_init( 'https://www.altercpa.one/fltr/123-abcd-45' );
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $_SERVER );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
$result = curl_exec( $curl );
curl_close( $curl );
$result = $result ? json_decode( $result, true ) : [];
if ( isset( $result['action'] && $result['action'] == 'allow' ) {
    include( 'target-index.php' );
} else include( 'dummy-index.php' );

Successful server responce example:

{
   "status": "ok",
   "action": "allow",
   "url": "http://black.site/url"
}

Error response example:

{
   "status": "error",
   "error": "access-denied"
}

Campaign setup

URL: https://www.altercpa.one/api/filter/set.json?id={token}&domain={host}

The function modifies the filtering campaign parameters or creates a new campaign. If a campaign identifier is passed in the uid field, the function will modify the existing campaign by this identifier. If the identifier is not passed, but the campaign domain is provided in the domain field, the function will attempt to find a campaign with the specified domain, and if it does not exist, it will create a new one.

The function can accept the following parameters:

Field Description
uid Identifier of the filtering campaign (recommended).
domain Domain or name of the filtering campaign (use unique names).
mode Campaign operation mode:
  • 0 - Automatic: filter enabled (default)
  • 1 - Pause: always show the dummy site
  • 2 - Disabled: always show the target site
  • 3 - Training: always show the dummy site
  • 4 - Training: always show the target site
geo List of two-letter ISO country codes where the filter works. Provided as an array or a string separated by commas, for example: ru,kz,by
mblack
mwhite
Operation mode of the target site (mblack) and dummy site (mwhite), option from the list:
  • 0 - Redirect by link (302)
  • 5 - Redirect and glue domain (301)
  • 6 - Redirect via separate page (meta)
  • 9 - Redirect via script (JS)
  • 1 - Open file with this name
  • 2 - Show this link in iframe
  • 7 - Show content by link (curl)
  • 3 - Show content by link without changes
  • 4 - Embed to WordPress
  • 8 - Show blank page
black Target site: link or file name.
white Dummy site: link or file name.
trash Number of trash visits, integer, default is 0.
proto IP protocol version:
  • 0 - Accept traffic of any protocol (default)
  • 1 - Accept only IPv4 traffic
  • 2 - Accept only IPv6 traffic
mobile Type of allowed traffic:
  • 0 - Any traffic (default)
  • 1 - Mobile traffic only
  • 2 - Desktop traffic only
  • 3 - Mobile traffic: iOS only
  • 4 - Mobile traffic: excluding iOS
os Allowed operating systems, array or list of IDs separated by commas:
  • 5 - Android
  • 8 - BlackBerry
  • 3 - Linux
  • 2 - MacOS
  • 7 - Symbian
  • 1 - Windows
  • 6 - Windows Mobile
  • 4 - iOS
browser Allowed browsers, array or list of IDs separated by commas:
  • 1 - Chrome
  • 6 - Edge
  • 7 - Facebook
  • 2 - Firefox
  • 8 - Instagram
  • 3 - MSIE
  • 5 - Opera
  • 4 - Safari
  • 9 - Tik-Tok
  • 10 - WebView
ignore Ignore the request domain and do not check its match with the campaign name, 0 or 1 (default).
ipmain Check only the main IP address of the request against the blacklist, 0 or 1 (default).
lang Check the visitor's language against the list of allowed countries, 0 or 1 (default).
adid Check the ad network click identifier, 0 (default) or 1.
list List of traffic filters, array or list separated by commas, empty by default.
langs List of two-letter ISO codes of allowed languages, array or list separated by commas, empty by default.
nogeo List of two-letter ISO codes of countries from which access is prohibited. Specify if the list of allowed countries is empty.
uwl Whitelist of words in URL, specified as text one per line.
ubl Blacklist of words in URL, specified as text one per line.
wl Whitelist of IP addresses, specified as text one per line, can contain IP addresses and subnets.

The result of the function execution is an associative array:

Field Description
status The result of the operation: ok in case of successful execution, error in case of an error.
error Error code for status error with value from the list:
  • access - the specified campaign does not belong to you.
  • no-site - campaign with such an identifier was not found.
  • no-domain - no domain or campaign name was specified.
  • db - database system error occurred.
id Numeric identifier of the campaign.
api Link to the API function for checking visits by this campaign.

Successful server responce example:

{
    "status": "ok",
    "id": 4567,
    "api": "https://www.altercpa.one/fltr/123-654b807372f614e64b9-4567"
}

Error response example:

{
    "status": "error",
    "error": "no-domain"
}

Campaigns list

URL: https://www.altercpa.one/api/filter/list.json?id={token}

The function returns a list of campaigns created in the traffic filtering section. The function does not have additional parameters.

The result of the function is a list of associative arrays with the following fields:

Field Description
id Filter campaign identifier.
api API link for checking visits for this campaign.
domain Filter campaign name.
mode Campaign mode (see campaign settings).
stats Filter campaign statistics. Associative array with fields:
  • click - total number of visits.
  • black - number of target visits.
  • white - number of blocked visits.
  • leads - total number of leads.
  • approve - number of approved leads.
  • cancel - number of rejected leads.
  • cash - total earnings.
  • cr - conversion rate for target visits.
  • epc - earnings per target visit.
  • appr - approval rate.

Successful server responce example:

[
    {
        "id": 4567,
        "api": "https://www.altercpa.one/fltr/123-654b807372f614e64b9-4567",
        "domain": "pretty-domain.com",
        "mode": 0,
        "stats": {
            "click": 180,
            "black": 123,
            "white": 57,
            "leads": 11,
            "approve": 6,
            "cancel": 1,
            "cash": 387.44,
            "cr": 8.94,
            "epc": 3.15,
            "appr": 54.55
        }
    },
    ...
]

Get campaign info

URL: https://www.altercpa.one/api/filter/get.json?id={token}&domain={host}

The function returns filtering campaign data. If a campaign identifier is passed in the uid field, the function will retrieve the campaign through this identifier. If a campaign domain is passed in the domain field, the function will attempt to find a campaign with the specified domain.

The function can take the following parameters as input:

Field Description
uid Filter campaign identifier (recommended).
domain Domain or name of the filtering campaign (use unique names).

The result of the function is an associative array with the following fields:

Field Description
id Identifier of the filtering campaign.
api API link for checking visits by this campaign.
domain Name of the filtering campaign.
mode Campaign operation mode (see campaign settings).
geo List of two-letter ISO country codes where the filter is active (array).
mblack Target site operation mode (see campaign settings).
black Target site: link or file name.
mwhite Dummy site operation mode (see campaign settings).
white Dummy site: link or file name.
trash Number of trash visits.
proto IP protocol version (see campaign settings).
mobile Type of acceptable traffic (array, see campaign settings).
os Acceptable operating systems (array, see campaign settings).
browser Acceptable browsers (array, see campaign settings).
ignore Ignore request domain and do not check for match with campaign name.
ipmain Check only the main IP address of the request against the blacklist.
lang Check the visitor's language against the list of allowed countries.
adid Check the ad network click identifier.
list Traffic filter list (array).
langs List of two-letter ISO codes of acceptable languages (array).
nogeo List of two-letter ISO country codes from which access is prohibited (array).
uwl Whitelist of words in URL (array).
ubl Blacklist of words in URL (array).
wl Whitelist of IP addresses (array).
stats Filtering campaign statistics. Similar to the campaign list function.
postback Postback samples for mini-tracker. Associative array with fields:
  • new - new lead.
  • approve - approved lead.
  • paid - approved lead with payout in macro {payout}.
  • cancel - rejected lead.

Successful server responce example:

{
    "id": 4567,
    "api": "https://www.altercpa.one/fltr/123-654b807372f614e64b9-4567",
    "domain": "pretty-domain.com",
    "mode": 0,
    "geo": [ "ru", "ua", "by" ],
    "mblack": 1,
    "black": "https://my-main-page.com/",
    "mwhite": 0,
    "white": "http://natribu.org/",
    "trash": 0,
    "proto": 0,
    "mobile": 0,
    "os": [],
    "browser": [],
    "ignore": false,
    "ipmain": false,
    "lang": false,
    "adid": false,
    "list": [],
    "langs": [],
    "nogeo": [],
    "uwl": [],
    "ubl": [],
    "wl": [],
    "stats": {
        "click": 180,
        "black": 123,
        "white": 57,
        "leads": 11,
        "approve": 6,
        "cancel": 1,
        "cash": 387.44,
        "cr": 8.94,
        "epc": 3.15,
        "appr": 54.55
    },
    "postback": {
        "new": "https://www.altercpa.one/api/filter/postback.json?id=123-654b807372f614e64b9&uid=11&status=new",
        "approve": "https://www.altercpa.one/api/filter/postback.json?id=123-654b807372f614e64b9&uid=11&status=approve",
        "paid": "https://www.altercpa.one/api/filter/postback.json?id=123-654b807372f614e64b9&uid=11&status=approve&payout={payout}",
        "cancel": "https://www.altercpa.one/api/filter/postback.json?id=123-654b807372f614e64b9&uid=11&status=cancel"
    }
}

Error response example:

{
    "status": "error",
    "error": "no-site"
}

Delete campaign

URL: https://www.altercpa.one/api/filter/del.json?id={token}&domain={host}

The function deletes a filtering campaign. If the campaign identifier is passed in the uid field, the function will delete the campaign by this identifier. If the campaign domain is passed in the domain field, the function will attempt to find the campaign with the specified domain.

The function can accept the following parameters:

Field Description
uid Filtering campaign identifier (recommended).
domain Campaign domain or name (use unique names).

The result of the function execution is an associative array:

Field Description
status The result of the operation: ok in case of successful execution, error in case of an error.
error Error code for status error with value from the list:
  • access - the specified campaign does not belong to you.
  • no-site - campaign with such an identifier not found.
  • no-domain - no domain or campaign name specified.
  • db - a system error occurred with the database.
id Numeric campaign identifier.

Successful server responce example:

{
    "status": "ok",
    "id": 4567
}

Error response example:

{
    "status": "error",
    "error": "no-site"
}

Download filtering file

URL: https://www.altercpa.one/api/filter/make.json?id={token}&domain={host}

This function downloads a prepared file for the filter campaign. If the campaign identifier is passed in the uid field, the function will extract the campaign by this identifier. If the campaign domain is passed in the domain field, the function will attempt to find the campaign with the specified domain. The response of the function is the index.php file.

The function can accept the following parameters:

Field Description
uid The identifier of the filtering campaign (recommended).
domain The domain or name of the filtering campaign (use unique names).

The result of the function execution is the index.php file in case of success, or an associative array in case of error:

Field Description
status Result of the operation: error in case of error.
error Error code for status error with value from the list:
  • access - the specified campaign does not belong to you.
  • no-site - the campaign with the specified identifier was not found.
  • no-domain - the domain or campaign name is not specified.

Block IP address or header

URL: https://www.altercpa.one/api/filter/block.json?id={token}&list={list}&ip={ip}

This function adds data to the selected personal blacklist. It can block both IP addresses and ranges, as well as headers. The contents of the fields and the used identifiers are described in the blacklist documentation.

The function can accept the following parameters:

Field Description
list Blacklist identifier (mandatory parameter).
ip IP address or subnet to be blocked.
size Subnet size to block (recommended 24 for IPv4 and 64 for IPv6).
value Header content to be blocked.
regex Use regular expression check instead of substring search, 0 or 1.
type Type of header to block (see blacklist documentation).
comment Comment on the blocked entity (see blacklist documentation).

The result of the function execution is an associative array:

Field Description
status The result of the operation: ok in case of successful execution, error in case of an error.
error Error code for status error with value from the list:
  • bad-list - invalid blacklist ID.
  • bad-ip - invalid IP address.
  • bad-size - incorrect subnet size.
  • bad-value - incorrect header content to block.
  • bad-type - incorrect type of header to block.
  • failed - a system error occurred with the database.

Successful server responce example:

{
    "status": "ok",
    "id": 1234567
}

Error response example:

{
    "status": "error",
    "error": "bad-list"
}

Send postback to mini-tracker

URL: https://www.altercpa.one/api/filter/postback.json?id={token}&uid={uid}&status={status}

This function is responsible for operating the built-in mini-tracker. It increases the lead counters with statuses like waiting, approval, and cancellation, as well as increments the earnings amount. It does not support any event deduplication.

The function can accept the following parameters:

Field Description
uid Filtering campaign identifier (required parameter).
status Lead status (required parameter):
  • New - lead, wait, process, hold, new
  • Approved - approve, sale, approved, confirm, confirmed
  • Rejected - cancel, trash, cancelled, reject, fake
payout Payout amount for approved lead.

The result of the function execution is an associative array:

Field Description
status The result of the operation: ok in case of successful execution, error in case of an error.
error Error code for status error with value from the list:
  • no-id - filtering campaign ID not provided.
  • bad-id - invalid filtering campaign ID.
  • bad-status - unable to recognize status.

Successful server responce example:

{
    "status": "ok"
}

Error response example:

{
    "status": "error",
    "error": "bad-status"
}

Integration with tracker

Integration functions are responsible for connecting third-party services and transmitting conversion data.

Postback

URL: https://www.altercpa.one/api/tracker/postback.json?id={token}&click={click}

The most important function of interaction with the tracker. Creates a new lead or modifies an existing lead based on the click or flow IDs sent. You can use two calling options:

The function can take the following parameters as input:

Field Description
click Character click ID.
flow Character flow ID.
uid Unique lead identifier on the advertiser's side.
status Lead status, optimal: new, hold, approve, cancel, trash.
goal Character ID of goal.
price Lead price.
currency Three-letter ISO code for the lead currency, by default usd.
convert The ISO code of the currency to convert the payout amount to is not used by default.
name Customer's name.
phone Customer's phone (without validation and correction).
email Customer's email (without validation and correction).
comment Custom comment to the lead.
meta[xxx] Custom lead field with name xxx.
utm_source Tag UTM Source to replace the one received from the click.
utm_campaign Tag UTM Campaign to replace the one received from the click.
utm_content Tag UTM Content to replace the one received from the click.
utm_term Tag UTM Term to replace the one received from the click.
utm_medium Tag UTM Medium to replace the one received from the click.
subid Tag SubID to replace the one received from the click.
adid Ad click ID to replace the one received from the click.
data1 Custom data 1 to replace the one received from the click.
data2 Custom data 2 to replace the one received from the click.
stn Status or list of statuses that are recognized as new lead.
sth Status or list of statuses that are recognized as lead in hold.
sta Status or list of statuses that are recognized as approved lead.
stc Status or list of statuses that are recognized as cancelled lead.
stt Status or list of statuses that are recognized as trash.
ip Lead IP address.
geo Two-letter ISO code of lead country.
ua User-Agent of the lead to determine the OS and browser.
referer Referer of the visit to replace the one received from the click.

The result of the function is an associative array:

Field Description
status The result of the operation: ok in case of success, error in case of an error.
error Error code for status error with value from the list:
  • access - the specified click or flow does not belong to you.
  • bad-click - no click found with this ID.
  • bad-flow - no flow found with this ID.
  • db - a system error occurred while working with the database.
  • no-changes - no changes were required, the lead is already in the right state.
  • no-click - no click ID or flow specified.
id The numeric ID of the lead that the action was taken on.
create If a new lead was created - true, if an existing one was changed - false.
stage The status the lead is in: new, hold, approve, cancel, trash.

Example of a successful server response:

{
    "status": "ok",
    "id": 1337,
    "create": true,
    "stage": "new"
}

Example of a server response with an error:

{
    "status": "error",
    "error": "no-changes"
}

Spend import

URL: https://www.altercpa.one/api/tracker/spend.json?id={token}

The function sets the click price for traffic according to the specified conditions. Allows you to use the ROI calculation functionality. Data can be transmitted in both GET and POST requests. The request must contain the cpc or cost parameters and at least one condition (dates, flow, UTM tags).

The function can take the following parameters as input:

Field Description
cost The total price for all clicks during this period.
cpc Price per one click.
from The start date of the period in the format YYYY-MM-DD, Unix Timestamp, or any other format recognized by the strtotime function.
to The end date of the period in the format YYYY-MM-DD, Unix Timestamp, or any other format recognized by the strtotime function.
flow Character identifier of the flow. You can pass an array of identifiers.
way Numeric identifier of the way within the flow. You can pass an array of identifiers.
currency Three-letter ISO code for the click currency, by default usd.
geo Two-letter ISO code of click counrty.
domain The domain where click appeared.
utm_source The UTM Source tag by which the click was registered.
utm_campaign The UTM Campaign tag by which the click was registered.
utm_content The UTM Content tag by which the click was registered.
utm_term The UTM Term tag by which the click was registered.
utm_medium The UTM Medium tag by which the click was registered.
subid The SubID tag by which the click was registered.
valid Set the price only for valid clicks: targeted clicks that pass the filter.
unique Set the price only for unique clicks.

You can also simultaneously update several price tags with one request; to do this, combine all requests into a batch array and send it via POST, for example:

{
    "batch": [
        {
            "flow": "face",
            "cost": 1984,
            "currency": "usd"
        },
        {
            "from": "2020-04-04 00:00:00",
            "to": "2020-04-07 23:59:59",
            "cpc": 1.337,
            "currency": "eur"
        }
    ]
}

The result of the function is an associative array:

Field Description
status The result of the operation: ok in case of success, error in case of an error.
error Error code for status error with value from the list:
  • empty - no data to put into price tags.
ok / bad Number of successful and unsuccessful price setting requests. Usually contains the response ok=1

Example of a successful server response:

{
    "status": "ok",
    "ok": 1,
    "bad": 0
}

Example of a server response with an error:

{
    "status": "error",
    "error": "empty"
}

Statistics of tracker

Statistics functions provide access to reports on leads and clicks.

Leads list

URL: https://www.altercpa.one/api/tracker/leads.json?id={token}

The function retrieves the list of leads and returns it as an associative array in the leads field. The function has no formal limits on the number of leads displayed, but it is not recommended to load more than a thousand leads at a time. If you get a 500 error, it means that there was not enough memory for your request, you need to reduce the request period.

The function can accept the following GET filtering parameters as input:

Field Description
from Report start date in YYYY-MM-DD format and tracker timezone.
to Report end date in YYYY-MM-DD format and tracker timezone.
ufrom Report start date in Unix Timestamp format.
uto Report end date in Unix Timestamp format.
status Character status of the lead:
  • new - new leads.
  • hold - leads in the hold.
  • approve - approved leads.
  • cancel - cancelled leads.
  • trash - leads in trash.
  • valid - valid leads (everything except trash).
  • wait - pending leads (new and hold).
  • good - good leads (hold and approve).
  • bad - bad leads (cancelled and trash).
geo Two-letter ISO code of lead country.
flow Character flow ID.
way Numeric way ID.
click Character click ID.
site Numeric site ID.
goal Character goal ID.
filter The result of the filters:
  • 0 - target visits.
  • 1 - blocked: bot.
  • 2 - blocked: blacklist.
  • 3 - blocked: country.
  • 4 - blocked: language.
  • 5 - blocked: filtering campaign.
domain The domain from which the lead was sent.
ip Lead IP address.
utm_source The value of UTM Source tag.
utm_campaign The value of UTM Campaign tag.
utm_content The value of UTM Content tag.
utm_term The value of UTM Term tag.
utm_medium The value of UTM Medium tag.
subid The value of SubID tag.

The result of the function is an associative array:

Field Description
status The result of the operation: ok in case of success, error in case of an error.
leads An array of leads, the composition of the fields is analyzed further.
error Error code for status error with value from the list:
  • access - you are trying to access data that does not belong to you.
  • payment-required - your subscription has expired, renew your subscription.

Inside the leads field, leads are represented by an associative array with fields:

Field Description
id Lead numeric ID.
time Lead arrival time in UNIX Timestamp format.
click Character click ID.
uid Unique lead identifier on the advertiser's side.
flow Character flow ID.
way Numeric way ID.
site Numeric site ID.
siteurl Site URL.
filter The result of the filters:
  • 0 - target visits.
  • 1 - blocked: bot.
  • 2 - blocked: blacklist.
  • 3 - blocked: country.
  • 4 - blocked: language.
  • 5 - blocked: filtering campaign.
status Character status of the lead:
  • new - new lead.
  • hold - lead in the hold.
  • approve - approved lead.
  • cancel - cancelled lead.
  • trash - lead in trash.
custom Real statustext of the lead sent by the advertiser.
goal Character goal ID.
price Lead price (always available regardless of status).
currency Lead price currency, by default usd.
ip Lead IP address.
geo Two-letter ISO code of lead country.
name Customer's name.
phone Customer's phone (without validation and correction).
email Customer's email (without validation and correction).
comment Lead comment.
meta Array of additional lead fields.
ua Browser User Agent
referer The referrer from which the lead was sent.
adid Ad click ID (fbclid, gclid, adclid, clid, adid).
data1 Custom data 1.
data2 Custom data 2.
domain The domain from which the lead was sent.
utm_source The value of UTM Source tag.
utm_campaign The value of UTM Campaign tag.
utm_content The value of UTM Content tag.
utm_term The value of UTM Term tag.
utm_medium The value of UTM Medium tag.
subid The value of subid tag.

Example of a successful server response:

{
    "status": "ok",
    "leads": [
        {
            "id": 1,
            "time": 1691303223,
            "click": "ac13",
            "uid": "c1vvkg272m16",
            "flow": "ecb4",
            "way": 123,
            "site": 42,
            "siteurl": "https://meow.pro/c8/cfb72fe561f0/",
            "filter": 0,
            "status": "approve",
            "custom": "Confirmed",
            "goal": "paid",
            "price": 18,
            "currency": "usd",
            "ip": "12.34.56.78",
            "geo": "de",
            "name": "Hans",
            "phone": "+49 (30) 226-511-83",
            "email": "[email protected]",
            "comment": "Confirmed on sunday",
            "meta": {
                "foo": "bar",
                "bar": "foo"
            },
            "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Safari\605.1.15",
            "referer": "https://meow.pro/c8/cfb72fe561f0/?subid=purr",
            "adid": "bf9d4aa8-4979-11ee-94c6-005056aec456",
            "data1": "wj80b89eit8epaarikhe2oge",
            "data2": false,
            "utm_source": "fb",
            "utm_campaign": "1013444211662",
            "utm_content": "432211555332166",
            "utm_term": false,
            "utm_medium": false,
            "domain": "meow.pro",
            "subid": "purr"
        },
        ...
    ]
}

Example of a server response with an error:

{
    "status": "error",
    "error": "payment-required"
}

Click statistics

URL: https://www.altercpa.one/api/tracker/stats.json?id={token}

The function collects general statistics on the number of clicks and leads, broken down by goals for the selected period according to the specified criterion.

The function can accept the following GET filtering parameters as input:

Field Description
from* Report start date in YYYY-MM-DD format (required).
to* Report end date in YYYY-MM-DD format (required).
item* Element by which statistics are grouped (required):
  • date - the date the click and lead were received.
  • hour - hour of the click and lead.
  • flow - flow ID.
  • way - way ID.
  • site - site ID.
  • filter - filtering results.
  • geo - country.
  • mobile - device type.
  • os - operating system.
  • browser - browser.
  • ip - IP address.
  • utmd - domain.
  • subid - SubID tag.
  • utms - UTM Source tag.
  • utmc - UTM Campaign tag.
  • utmn - UTM Content tag.
  • utmt - UTM Term tag.
  • utmm - UTM Medium tag.
geo Two-letter ISO code of lead country.
flow Character flow ID.
way Numeric way ID.
site Numeric site ID.
filter The result of the filters:
  • 0 - target visits.
  • 1 - blocked: bot.
  • 2 - blocked: blacklist.
  • 3 - blocked: country.
  • 4 - blocked: language.
  • 5 - blocked: filtering campaign.
hour Lead arrival hour (number from 0 to 23).
mobile Traffic type:
  • 0 - desktop traffic.
  • 1 - mobile traffic.
os Operating system:
  • 0 - Other
  • 1 - Windows
  • 2 - MacOS
  • 3 - Linux
  • 4 - iOS
  • 5 - Android
  • 6 - Windows Mobile
  • 7 - Symbian
  • 8 - BlackBerry
browser Browser:
  • 0 - Other
  • 1 - Chrome
  • 2 - Firefox
  • 3 - MSIE
  • 4 - Safari
  • 5 - Opera
  • 6 - Edge
  • 7 - Facebook
  • 8 - Instagram
  • 9 - Tik-Tok
  • 10 - WebView
  • 11 - Bot
domain The domain from which the lead was sent.
ip Lead IP address.
utm_source The value of UTM Source tag.
utm_campaign The value of UTM Campaign tag.
utm_content The value of UTM Content tag.
utm_term The value of UTM Term tag.
utm_medium The value of UTM Medium tag.
subid The value of subid tag.

The result of the function is an associative array:

Field Description
status The result of the operation: ok in case of success, error in case of an error.
stats The array of statistics results, the composition of the fields is analyzed further.
total The total results for the entire query.
error Error code for status error with value from the list:
  • access - you are trying to access data that does not belong to you.
  • no-item - the criterion by which statistics should be groupped is not specified.
  • no-from - start date of statistics period is not specified.
  • no-to - end date of statistics period is not specified.
  • payment-required - your subscription has expired, renew your subscription.

The stats array and the total field are an associative array:

Field Description
id Statistics element ID.
name Statistics element name.
click Total clicks amount.
unique Unique clicks amount.
total Total leads number.
cv Valid leads number.
cn New leads number.
ch Hold leads number.
ca Approved leads number.
cc Cancelled leads number.
ct Trash leads number.
mt Total earnings.
mh Holded leads earnings.
ma Approved leads earnings.
cr Conversion: the ratio of valid leads to unique clicks.
epc EPC: the ratio of approved earnings to unique clicks.
appr Approve: the ratio of approved leads to valid ones.
app Total approve: the ratio of approved leads to all leads.
goal The array with statistics for each individual goal. Contains the same fields as the rest of the statistics, except for the number of clicks.

Example of a successful server response:

{
    "status": "ok",
    "stats": {
        "20230805": {
            "id": 20230805,
            "name": "2023-08-05",
            "click": 44,
            "unique": 22,
            "total": 6,
            "cv": 4,
            "cn": 1,
            "ch": 1,
            "ca": 2,
            "cc": 0,
            "ct": 2,
            "mh": 20.0,
            "ma": 135.0,
            "mt": 155.0,
            "cr": 18.2,
            "epc": 6.75,
            "appr": 66.7,
            "app": 33.3
        },
        ...
    },
    "total": {
        "click": 175,
        "unique": 58,
        "total": 25,
        "cv": 23,
        "cn": 11,
        "ch": 8,
        "ca": 9,
        "cc": 0,
        "ct": 2,
        "mh": 160.0,
        "ma": 1200.0,
        "mt": 1360.0,
        "cr": 5.17,
        "epc": 12.3,
        "appr": 46.7,
        "app": 31.0
    }
}

Example of a server response with an error:

{
    "status": "error",
    "error": "no-item"
}