Agency statistics

Documentation for all functionality to retrieve agency statistics using the Revive Adserver REST API, with breakdowns by day, by advertiser, by campaign, by banner, by publisher, or by zone. There are also a number of helpful notes about date ranges.

getAgencyDailyStatistics

Description: Retrieve the statistics for an agency for a specified date range, grouped by day

Implementation: URL/agc/[agencyId]/statistics/daily/[start_date]/[end_date]

Method: GET

Json example:

GET https://api.example.com/agc/1/statistics/daily/2018-05-26/2018-05-27

Response example:

{
    "id": 1,
    "start_date": "2018-05-26",
    "end_date": "2018-05-27",
    "days": {
        "data": [
            {
                "impressions": 15,
                "clicks": 2,
                "requests": 31,
                "revenue": 0.0114,
                "day": "2018-05-26"
            },
            {
                "impressions": 16,
                "clicks": 1,
                "requests": 31,
                "revenue": 0.0121,
                "day": "2018-05-27"
            }
        ]
    }
}

Notes

See the notes at the end of the page with regard to date ranges and invalid agency IDs.

getAgencyAdvertiserStatistics

Description: Retrieve the statistics for an agency for a specified date range, grouped by advertiser

Implementation: URL/agc/[agencyId]/statistics/advertiser/[start_date]/[end_date]

Method: GET

Json example:

Method:
GET http://api.example.com/agc/1/statistics/advertiser/2018-05-26/2018-05-27

Response example:

{
    "id": 1,
    "start_date": "2018-05-26",
    "end_date": "2018-05-27",
    "advertisers": {
        "data": [
            {
                "impressions": "31",
                "clicks": "3",
                "requests": "62",
                "revenue": "0.0235",
                "advertiserid": "2",
                "advertisername": "Statistics Demo Advertiser"
            }
        ]
    }
}

Notes

See the notes at the end of the page with regard to date ranges and invalid agency IDs.

getAgencyCampaignStatistics

Description: Retrieve the statistics for an agency for a specified date range, grouped by campaign

Implementation: URL/agc/[agencyId]/statistics/campaign/[start_date]/[end_date]

Method: GET

Json example:

Method:
GET http://api.example.com/agc/1/statistics/campaign/2018-05-21/2018-05-27

Response example

{
    "id": 1,
    "start_date": "2018-05-21",
    "end_date": "2018-05-27",
    "campaigns": {
        "data": [
            {
                "impressions": "230",
                "clicks": "4",
                "requests": "305",
                "revenue": "0.1742",
                "advertiserid": "2",
                "advertisername": "Statistics Demo Advertiser",
                "campaignid": "4",
                "campaignname": "Statistics Demo Campaign"
            }
        ]
    }
}

Notes

See the notes at the end of the page with regard to date ranges and invalid agency IDs.

getAgencyBannerStatistics

Description: Retrieve the statistics for an agency for a specified date range, grouped by banner

Implementation: URL/agc/[agencyId]/statistics/banner/[start_date]/[end_date]

Method: GET

Json example:

Method:
GET http://api.example.com/agc/1/statistics/banner/2018-05-21/2018-05-27

Response example

{
    "id": 1,
    "start_date": "2018-05-21",
    "end_date": "2018-05-27",
    "banners": {
        "data": [
            {
                "impressions": "230",
                "clicks": "4",
                "requests": "305",
                "revenue": "0.1742",
                "advertiserid": "2",
                "advertisername": "Statistics Demo Advertiser",
                "campaignid": "4",
                "campaignname": "Statistics Demo Campaign",
                "bannerid": "12",
                "bannername": "Statistics Demo Banner"
            }
        ]
    }
}

Notes

See the notes at the end of the page with regard to date ranges and invalid agency IDs.

getAgencyPublisherStatistics

Description: Retrieve the statistics for an agency for a specified date range, grouped by publisher

Implementation: URL/agc/[agencyId]/statistics/publisher/[start_date]/[end_date]

Method: GET

Json example:

Method:
GET http://api.example.com/agc/1/statistics/publisher/2018-05-21/2018-05-27

Response example

{
    "id": 1,
    "start_date": "2018-05-21",
    "end_date": "2018-05-27",
    "publishers": {
        "data": [
            {
                "impressions": "230",
                "clicks": "4",
                "requests": "305",
                "revenue": "0.1742",
                "publisherid": "4",
                "publishername": "Demo Statistics Website"
            }
        ]
    }
}

Notes

See the notes at the end of the page with regard to date ranges and invalid agency IDs.

getAgencyZoneStatistics

Description: Retrieve the statistics for an agency for a specified date range, grouped by zone

Implementation: URL/agc/[agencyId]/statistics/zone/[start_date]/[end_date]

Method: GET

Json example:

Method:
GET http://api.example.com/agc/1/statistics/zone/2018-05-21/2018-05-27

Response example

{
    "id": 1,
    "start_date": "2018-05-21",
    "end_date": "2018-05-27",
    "zones": {
        "data": [
            {
                "impressions": "230",
                "clicks": "4",
                "requests": "305",
                "revenue": "0.1742",
                "publisherid": "4",
                "publishername": "Demo Statistics Website",
                "zoneid": "11",
                "zonename": "Demo Statistics Zone"
            }
        ]
    }
}

Notes

See the notes at the end of the page with regard to date ranges and invalid agency IDs.


Notes

  • The end date in the request is optional. If omitted, the response will consist of just one day (the start date)
  • If you omit both the start date and the end date, or use a invalid date notation for the start date, the end date, or perhaps even both, there will be a response indicating the problem, as follows, for example:
    {
        "error": {
            "type": "DateException",
            "message": "Start date is not valid"
        }
    }
  • Requesting statistics for a date range where the end date is earlier than the start date, results in the following response, for example:
    {
        "error": {
            "type": "Exception",
            "message": "The start date is after the end date"
        }
    }
  • Requesting statistics for a date range that does not have any data, results in the following response, for example:
    {
        "id": 1,
        "start_date": "2017-05-21",
        "end_date": "2017-05-27",
        "days": {
            "data": []
        }
    }
  • Requesting statistics for an agency that doesn’t exist results in the following response:
    {
        "error": {
            "type": "Exception",
            "message": "Unknown agencyId Error"
        }
    }

Current version

The most recently released version of the Revive Adserver REST API is v4.3.0 (publication date May 28, 2018).

See Release Notes

Compatibility

Revive Adserver REST API is compatible with all versions of Revive Adserver v4.0 and higher. It may also be compatible with Revive Adserver v3.x (and also with OpenX Source v2.8 and higher), but this can not be guaranteed.

Revive Adserver REST API is compatible with all supported versions of PHP, including PHP7.

Also see Technical Requirements, Product Content, and Installation Instructions.

Our Recent Tweets