PeriodReport

1
2
3
4
5
{
    "Name": "Mopedo.Reporting.PeriodReport",
    "Kind": "EntityResource",
    "Methods": ["GET", "REPORT", "HEAD"]
}

PeriodReport is a short-term reporting resource that enables flexible aggregated spending reports, grouped by some given time period. Say, for example, that we want to get the daily spending for some campaign’s spending during the last 60 days. This could be done with 60 separate requests to the DailySpendingReport resource – but with the PeriodReport resource we can do it with just one. The following properties can be used to specify the report parameters:

Report parameters

The following properties can be used in request URIs to specify the report parameters:

Properties marked in bold are required

Property name Type Description
Period enum The period to group reports by. Can be: Day, Month or Year
From datetime The time of the earliest period report contained in the response
To datetime The time of the latest period report contained in the response
CampaignId string An optional campaign id to filter against
BuyerId string An optional buyer id (of campaigns) to filter against
AdId string An optional Ad id to filter against

Format

The response is a list of reports with the following format:

Property name Type Description
Period datetime Name is e.g. Day. Value is a datetime describing the period
Campaigns array of strings The IDs of all campaigns contributing to the report
NrOfBids integer The number of bids generated during the period
NrOfWins integer The number of wins generated during the period
NrOfClicks integer The number of clicks generated during the period
WinRate float The number of wins divided by the number of bids
ClickRate float The number of clicks divided by the number of wins
TotalBidPrice Price The total amount bidded for during the period
TotalWinPrice Price The total amount spent during the period

Example

To get montly reports for October and November of 2017 using PeriodReport, we make this GET request to the REST API:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
GET https://my-dsp.com:8282/rest/periodreport/period=month&from=2017-10-01&to=2017-12-01
Headers: "Authorization: apikey mykey"
Response body:
[
    {
        "Month": "2017-10-01T00:00:00Z",
        "Campaigns": [
            "MyCampaign1"
        ],
        "NrOfBids": 51276,
        "NrOfWins": 11258,
        "NrOfClicks": 1211,
        "WinRate": 0.2196,
        "ClickRate": 0.1076,
        "TotalBidPrice": {
            "Amount": 2563.040000,
            "Currency": "USD",
            "CPM": false
        },
        "TotalWinPrice": {
            "Amount": 292.708000,
            "Currency": "USD",
            "CPM": false
        }
    },
    {
        "Month": "2017-11-01T00:00:00Z",
        "Campaigns": [
            "MyCampaign1"
        ],
        "NrOfBids": 801,
        "NrOfWins": 46,
        "NrOfClicks": 5,
        "WinRate": 0.0574,
        "ClickRate": 0.1087,
        "TotalBidPrice": {
            "Amount": 32.040000,
            "Currency": "USD",
            "CPM": false
        },
        "TotalWinPrice": {
            "Amount": 1.316423,
            "Currency": "USD",
            "CPM": false
        }
    }
]