This web service responds with the number of visits grouped by source type.
Method | Endpoint |
---|---|
POST |
/analytics/api/v1/traffic/sources/evolution |
Request example
{
"startDate": "2023-10-01",
"endDate": "2023-12-01",
"groupByPeriod": "month",
"filters": {
"pageId": [
"45d2564c-c877-4c8b-84cb-a9c3f7f8f97d",
"ft/home",
"ft/search",
"ft/reader",
"ft/viewer"
],
"language": "en-US",
"authenticated": true,
"sourceTypes": [
"direct",
"organic",
"referral",
"social"
]
}
}
Field | Type | Required? | Description |
---|---|---|---|
startDate |
String | Yes | Inclusive start date of the period. The start date must be in the past year. |
endDate |
String | Yes | Exclusive end date of the period. The end date must be later than the start date. |
groupByPeriod |
String | Yes | Period by which to group the page views. Valid values are month and day . |
filters |
Object | No | Field to specify which events to retrieve. |
pageId |
Array | No | Filter on page IDs. |
language |
String | No | Filter on the UI Locale (for example, en-US or fr-FR ). |
authenticated |
Boolean | No | Field to define users' status. If undefined, the web service returns page views for both authenticated and unauthenticated users. If set to true , the web service returns only navigation information for authenticated users. if set to false , the web service returns only navigation information for unauthenticated users. |
sourceTypes |
Array | No | Filter on the source type: direct , organic , referral , social . |
Response body
The following lines show an example of a JSON response body:
{
"startDate": "2023-10-01",
"endDate": "2023-12-01",
"results": [
{
"name": "direct",
"periods": [
{
"periodStartDate": "2023-10-01",
"periodEndDate": "2023-11-01",
"count": 456
},
{
"periodStartDate": "2023-11-01",
"periodEndDate": "2023-12-01",
"count": 415
}
]
},
{
"name": "organic",
"periods": [
{
"periodStartDate": "2023-10-01",
"periodEndDate": "2023-11-01",
"count": 5
},
{
"periodStartDate": "2023-11-01",
"periodEndDate": "2023-12-01",
"count": 1
}
]
},
{
"name": "referral",
"periods": [
{
"periodStartDate": "2023-10-01",
"periodEndDate": "2023-11-01",
"count": 28
},
{
"periodStartDate": "2023-11-01",
"periodEndDate": "2023-12-01",
"count": 8
}
]
}
]
}
Field | Type | Description |
---|---|---|
startDate |
String | Inclusive start date of the total period as defined in the request. |
endDate |
String | Exclusive end date of the total period as defined in the request. |
periodStartDate |
String | Inclusive start date of the period by which results are grouped. |
periodEndDate |
String | Exclusive end date of the period by which results are grouped. |
count |
String | The number of visits for the source type during the period by which results are grouped. |
Return code | Description |
---|---|
200 OK |
Returns data in JSON format. |