Site metrics endpoints

Returns all site metrics between two dates.

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

goalId

To return conversion metrics for a non-ecommerce goal


{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 93.00790024010534,
"name": "bounceRate",
"currency": "USD"
},
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 186.890756302521,
"name": "cartAverage",
"currency": "USD"
},
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 3649,
"name": "conversionCount",
"currency": "USD"
},
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 7.068828577516902,
"name": "conversionRate",
"currency": "USD"
},
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 1.1468321586244288,
"name": "pageviewAverage",
"currency": "USD"
},
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 22240,
"name": "revenueSum",
"currency": "USD"
},
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 3.1195242041669893,
"name": "sessionTimeAverage",
"currency": "USD"
},
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 51644,
"name": "visits",
"currency": "USD"
}
]
},
"success": true
}

The ratio between the visitors who entered the site and left it without having seen a second page and all visitors.

More information regarding the metric and how to interpret it…

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 93.00790024010534,
"name": "bounceRate",
"currency": "USD"
}
]
},
"success": true
}

The average cart amount is calculated by dividing the total revenue by the number of transactions. This metric is only accessible for “e-commerce” projects.

More information regarding the metric and how to interpret it…

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 186.890756302521,
"name": "cartAverage",
"currency": "USD"
}
]
},
"success": true
}

The number of sessions where a specified goal was reached. More information regarding the metric and how to interpret it…

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
goalId

Only required for non “e-commerce” projects. Goal filter for analysis.


If not specified for an “e-commerce” project, the API will return data for the “e-commerce” goal.

period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 3649,
"name": "conversionCount",
"currency": "USD"
}
]
},
"success": true
}

/v1/metrics/site/conversion-rate

Section titled /v1/metrics/site/conversion-rate

Ratio between the number of sessions where a specified goal was reached and the total number of sessions. More information regarding the metric and how to interpret it…

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
goalId

Only required for non “e-commerce” projects. Goal filter for analysis.


If not specified for an “e-commerce” project, the API will return data for the “e-commerce” goal.

segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 7.068828577516902,
"name": "conversionRate",
"currency": "USD"
}
]
},
"success": true
}

/v1/metrics/site/pageview-average

Section titled /v1/metrics/site/pageview-average

Average number page views during a session (a page that has been refreshed counts as one view).

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 1.1468321586244288,
"name": "pageviewAverage",
"currency": "USD"
}
]
},
"success": true
}

Sum of all the transaction amounts. This metric is only accessible for “e-commerce” projects.

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 22240,
"name": "revenueSum",
"currency": "USD"
}
]
},
"success": true
}

/v1/metrics/site/session-time-average

Section titled /v1/metrics/site/session-time-average

Average time spent from entry on the site to site exit for each visit.

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 3.1195242041669893,
"name": "sessionTimeAverage",
"currency": "USD"
}
]
},
"success": true
}

Number of sessions. More information regarding the metric and how to interpret it…

projectIdOnly required for an account-level API key. The target project.
startDate

Required. Beginning of date range for analysis.

  • Default: none
  • Must be a date prior to endDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

endDate

Required. End of date range for analysis.

  • Default: none
  • Must be a date after startDate
  • ISO format in UTC (eg. “2021-08-13T12:32:40.000Z”) or with a time zone offset (eg. “2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL)

device

Device filter for analysis.

  • Default: all
  • Available values: all, desktop, mobile, tablet
period

Granularity of the results. Can only be used on a date range larger then one day. It allows you to have data for each day instead of having a combine result.

  • Default: none
  • Available values: daily
segmentIds

Filter analysis with Contentsquare segments.

  • Default: All visitors
  • You can specify multiple segments separated by commas to retrieve the metrics for the intersection of the specified segments

{
"payload": {
"values": [
{
"startDate": "2021-07-16T00:00:00.000Z",
"endDate": "2021-07-22T00:00:00.000Z",
"value": 51644,
"name": "visits",
"currency": "USD"
}
]
},
"success": true
}