Follow

How to use Statistics methods?

Time to read: 7 min

topic.pngThe article covers the following topics:

General Info

First of all, to get started with API, you need to find your API-key. To do it, just navigate to 'Users' Tab - > 'Users management' -> 'User edit page':

Screenshot_36.png

 import.png Only the General manager has permission to get the 'User edit page'. 

Next thing you need is API URL, you can find it in 'Settings' Tab -> 'Settings' -> 'Tracking domains' -> 'URLs' section:

Markup_2020-07-22_at_13.29.20.png

click__1_.pngFind out more about where you can find your/Affiliate's API-key and API URL here

API Request Structure: GET/POST + api domain + path + ? + api-key=189471975956279174174.

It should be noted that header content-type - application/x-www-form-urlencoded is used on an ongoing basis.

Below will be introduced commonly used Statistics methods with examples of usage. 

[GET] Custom Statistics

To get custom statistics data via API, you need to navigate to the 'Statistics' section in the API Doc and choose the 'Custom statistics' method (follow the link):

chrome-capture__11_.gif

Here you may see a lot of parameters that can be used to receive needed data. Some of the parameters are required: 

  • slice[] - enter needed available custom slice or slices (hour, month, quarter, year, day, offer, country, city, os, os_version, device, device_model, browser, goal, sub1, sub2, sub3, sub4, sub5).

Additional slices only for General manager: advertiser, affiliate, manager, smart_id.

Additional slices only for users with special permissions: trafficback_reason. You can manage user's permissions via Admin  panel in 'Users' section - > 'User management' -> 'User edit page'.

  • filter[date_from] -  enter the date from which you want to get statistics in the format: YYYY-MM-DD.
  • filter[date_to] - enter the date to which you want to get statistics in the format: YYYY-MM-DD.

Example on how to get custom statistics via API:

https://api-rocketcompany.affise.com/3.0/stats/custom?api-key=a227fe0ec61dd5467368266c12345678&slice[]=hour&filter[date_from]=2020-02-24&filter[date_to]=2020-02-27

The response will look like: 

Screenshot_36.png

[GET] Conversions

To get conversions data via API, you need to navigate to the 'Statistics' section in the API Doc and choose the 'Conversions' method (follow the link):

import.pngKeep in mind that Conversions statistics available only for users who have permission to view the Statistics section. 

 Example on how to get conversions via API:

https://api-rocketcompany.affise.com/3.0/stats/conversions?api-key=a227fe0ec61dd5467368266c12345678&date_from=

The response will look like: 

Screenshot_56.png

import.png Keep in mind that the date_from parameter is required.

[GET] Conversion

To get conversions statistics data via API, you need to navigate to the 'Statistics' section in API Doc and choose the 'Conversions' method (follow the link):

import.pngKeep in mind that Conversion statistics available only for users with the General manager role. 

 Example on how to get conversions statistics via API:

https://api-rocketcompany.affise.com/3.0/stats/conversionsbyid?api-key=a227fe0ec61dd5467368266c12345678&id=5e575ee7c0417b8d008b456d

The response will look like: 

Screenshot_37.png

import.pngAvoid using action_id instead of conversion_id. Otherwise, the conversion will not be found, because action_id sends by Advertiser, and conversion_id generates by the Affise system. You can get conversion_id via [GET] Conversions method, where conversion_id is id.

[GET] Clicks 

To get clicks statistics data via API, you need to navigate to the 'Statistics' section in API Doc and choose 'Clicks' method (follow the link):

chrome-capture__33_.gif

Here you may see a lot of parameters that can be used to receive needed data. Some of the parameters are required: 

  • date_from - enter date from which you want to get statistics in the format: YYYY-MM-DD.
  • date_to - enter date to which you want to get statistics in the format: YYYY-MM-DD.

import.pngKeep in mind that Clicks statistics available only for users with the General manager role. 

 Example on how to get clicks statistics for the one day via API:

https://api-rocketcompany.affise.com/3.0/stats/clicks?api-key=35d1e0b180bea77b8545ec1d12345678&date_from=2020-04-01&date_to=2020-04-01

The response will look like: 

Screenshot_133.png

[GET] By cap

To get Cap statistics data via API, you need to navigate to the 'Statistics' section in the API Doc and choose the 'By cap' method (follow the link):

chrome-capture__35_.gif

Here you may see a lot of parameters that can be used to receive needed data. Some of the parameters are required: 

  • offer_id[] - Offer's ID.
  • fields[] - Fields for each offer in response. Available values: stats, stats_merged, descr. 

import.pngKeep in mind that statistics By cap available only for users with the General manager role. 

 Example on how to get Cap statistics via API:

https://api-rocketcompany.affise.com/3.0/stats/caps?api-key=35d1e0b180bea77b8545ec1d12345678&offer_id[]=132049&fields[]=stats

The response will look like: 

Screenshot_134.png

article.pngYou may also find the following articles helpful:

 If you have more questions on how to use Statistics methods, feel free to contact the Affise Support Team via support@affise.com or your Dedicated Account Manager.

Written by Anastasia Deryugina

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.