GET /offerStats (advertiser) API documentation
Get the same data available in the Offer reports (advertiser revenues by date, country, offer or user_id)
GET https://demo.trafficmanager.com/api/v1/offerStats/{startTime}/{endTime}/
Authentication:
The request must be authenticated with the following HTTP headers:x-api-key
: Your API key, found in the Security pagex-user-id
: Your User ID, found in the Security page
If the HTTP headers are not passed, but you are logged in to the TrafficManager panel, the current user is used instead (so you can easily preview or download the data using your browser)
GET Parameters:
- Required:
startTime
: Start time. Unix timestamp or any value accepted by strtotime. For example:2023-01-01
,today
,-10 minutes
...endTime
: End time. Unix timestamp or any value accepted by strtotime. For example:2023-01-01 23:59:59
,today 23:59:59
,-5 minutes
...- Optional:
-
groupBy
: comma-separated list that can contain the following values:date,offer,user,landingpage
(no space allowed)
If this parameter is set, the response will always include 15 values per row, that will be empty for the unselected groups. See below for more info. offer_id
: offer ID filter (if set, returns only the data for that offer)cc
: country filter (two-letter country code), if set, returns only the data for that country.timezone
: timezone. Valid values are listed here: Timezones. If not set, the network default timezone (UTC) will be used.
Returned values:
-
The response is a JSON array. The fields changes depending on whether the groupBy parameter is selected or not.
If thegroupBy
parameter is not set, each row will contain the following 9 fields. This is to maintain backwards compatibility with the first version of the api: - Date
- Offer ID and name (format: "#
id
-name
") - Number of impressions
- Number of clicks
- Number of unique clicks
- Number of conversions
- EPC (average payout per n clicks, calculated as: payout/clicks*n, where n is the system EPC factor, currently 100)
- Unique EPC (average payout per n unique clicks)
- Total payout to the affiliate
-
If the
groupBy
parameter is set, each row will contain these fields.
If a group (for example utm_content or offer) is not added to thegroupBy
string, it will be an empty string. - Date
- Offer ID and name (format: "#
id
-name
") - utm_source
- utm_medium
- utm_campaign
- utm_term
- utm_content
- Number of impressions
- Number of clicks
- Number of unique clicks
- Number of leads
- Number of conversions
- EPC (average payout per n clicks, calculated as: payout/clicks*n, where n is the system EPC factor, currently 100)
- Unique EPC (average payout per n unique clicks)
- Total payout to the affiliate
Request example
GET https://demo.trafficmanager.com/api/v1/offerStats/yesterday/yesterday/
Response example
{ "data": [ [ "2021-07-19", "#830 - Private offer - Exclusive offer XYZ", "-", "81", "41", "2", "0.94", "1.86", "0.08" ], [ "2021-07-19", "#900 - Best converting offer", "-", "12921", "10317", "1", "0.04", "0.05", "0.50" ] ], "status": 200 }
Request example
GET https://demo.trafficmanager.com/api/v1/offerStats/yesterday/yesterday/?groupBy=date,offer
Response example
{ "data": [ [ "2021-07-19", "#830 - Private offer - Exclusive offer XYZ", "", "", "", "", "", "-", "81", "41", "2", "0.94", "1.86", "0.08" ], [ "2021-07-19", "#900 - Best converting offer", "", "", "", "", "", "-", "12921", "10317", "1", "0.04", "0.05", "0.50" ] ], "status": 200 }
Request example
GET https://demo.trafficmanager.com/api/v1/offerStats/yesterday/yesterday/?groupBy=date
Response example
{ "data": [ [ "2021-07-19", "", "", "", "", "", "", "-", "87137", "74585", "32", "0.30", "0.35", "25.75" ] ], "status": 200 }