Site metrics endpoints
All site metrics
Section titled All site metricsGET /v1/metrics/site
Returns all site metrics between two dates.
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
period string
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.
Possible values: none (default),
daily
. -
segmentIds integer
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 integer
To return conversion metrics for a non-ecommerce goal.
Example of response
Bounce rate
Section titled Bounce rateGET /v1/metrics/site/bounce-rate
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… ↗
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
period string
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.
Possible values: none (default),
daily
. -
segmentIds integer
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
Example of response
Cart average
Section titled Cart averageGET /v1/metrics/site/cart-average
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… ↗
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
segmentIds integer
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
Example of response
Conversions
Section titled ConversionsGET /v1/metrics/site/conversions
The number of sessions where a specified goal was reached. More information regarding the metric and how to interpret it… ↗
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
goalId integer
Required only 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 string
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.
Possible values: none (default),
daily
. -
segmentIds integer
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
Example of response
Conversion rate
Section titled Conversion rateGET /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… ↗
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
period string
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.
Possible values: none (default),
daily
. -
goalId integer
Required only 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 integer
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
Example of response
Pageview average
Section titled Pageview averageGET /v1/metrics/site/pageview-average
Average number page views during a session (a page that has been refreshed counts as one view).
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
period string
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.
Possible values: none (default),
daily
. -
segmentIds integer
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
Example of response
Revenue
Section titled RevenueGET /v1/metrics/site/revenue
Sum of all the transaction amounts. This metric is only accessible for “e-commerce” projects.
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
period string
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.
Possible values: none (default),
daily
. -
segmentIds integer
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
Example of response
Session time average
Section titled Session time averageGET /v1/metrics/site/session-time-average
Average time spent from entry on the site to site exit for each visit.
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
period string
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.
Possible values: none (default),
daily
. -
segmentIds integer
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
Example of response
Visits
Section titled VisitsGET /v1/metrics/site/visits
Number of sessions. More information regarding the metric and how to interpret it… ↗
Query parameters
-
projectId integer
Required only for an account-level API key. The target project.
-
startDate ISO 8601 date string Required
Beginning of date range for analysis. Must be a date prior to
endDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
endDate ISO 8601 date string Required
End of date range for analysis. Must be a date after
startDate
.ISO format in UTC (for example “2021-08-13T12:32:40.000Z”) or with a time zone offset (“2021-08-13T12:32:40+02:00” or “2021-08-13T12:32:40%2B+02:00” when encoded in the URL).
-
device string
Device filter for analysis.
Possible values:
all
(default),desktop
,mobile
, ortablet
. -
period string
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.
Possible values: none (default),
daily
. -
segmentIds integer
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