Object endpoints
The metrics API replicates the behavior of the analysis context in Contentsquare. To get a metric, you can filter by device, segment etc. Plus, for page groups and zones metrics, you will have to define for which page group or zones you want data. To help you, we provide an API that retrieves these objects: segments, page groups etc.
Segments
Section titled Segments/v1/segments
Section titled /v1/segmentsGet the list of all segments for a project. More information regarding segments in Contentsquare
Parameters
Section titled ParametersprojectId | Only required for an account-level API key. The target project. |
---|---|
ids | Filter the results and get a list of segments that matches the ids provided.
|
Example of response
Section titled Example of response{ "payload": [ { "id": 1, "name": "New visitors", "source": "contentsquare", "createdAt": "2019-11-21T09:46:16.000Z", "updatedAt": "2019-11-21T09:46:16.000Z" } ], "success": true}
Goals
Section titled Goals/v1/goals
Section titled /v1/goalsGet the list of all goals for a project. More information regarding goals in Contentsquare
Example of response
Section titled Example of response{ "payload": [ { "id": 100, "name": "Reach Cart", "type": "pageview", "createdAt": "2019-10-05T10:34:42.670Z", "updatedAt": "2019-11-21T09:46:09.000Z" } ], "success": true}
projectId | Only required for an account-level API key. The target project. |
---|
Mappings
Section titled Mappings/v1/mappings
Section titled /v1/mappingsGet the list of all mappings for a project. More information regarding mappings in Contentsquare
Parameters
Section titled ParametersprojectId | Only required for an account-level API key. The target project. |
---|---|
ids | Filter the results and get a list of mappings that matches the ids provided. Multiple IDs should be separated by a comma |
Example of response
Section titled Example of response{ "payload": [ { "id": 101010, "name": "New Zoning Mapping", "description": "Test", "createdAt": "2019-11-05T09:44:51.000Z", "updatedAt": "2019-11-05T09:45:05.000Z" } ], "success": true}
/v1/mappings/{mappingId}
Section titled /v1/mappings/{mappingId}Get information for a specific mapping More information regarding mappings in Contentsquare
Parameters
Section titled ParametersprojectId | Only required for an account-level API key. The target project. |
---|
Example of response
Section titled Example of response{ "payload": [ { "id": 101010, "name": "New Zoning Mapping", "description": "Test", "createdAt": "2019-11-05T09:44:51.000Z", "updatedAt": "2019-11-05T09:45:05.000Z" } ], "success": true}
Page Groups
Section titled Page Groups/v1/mappings/{mappingId}/page-groups
Section titled /v1/mappings/{mappingId}/page-groupsGet all the page groups for a specific mapping More information regarding mappings and page groups in Contentsquare
Parameters
Section titled ParametersprojectId | Only required for an account-level API key. The target project. |
---|
Example of response
Section titled Example of response{ "payload": [ { "id": 1010, "name": "Product Pages", "category": "Other" } ], "success": true}
/v1/page-groups/{pageGroupId}
Section titled /v1/page-groups/{pageGroupId}Get information about a page and all the related mappings More information regarding page groups in Contentsquare
Parameters
Section titled ParametersprojectId | Only required for an account-level API key. The target project. |
---|
Example of response
Section titled Example of response{ "payload": { "id": 1010, "name": "Product pages", "category": "Other", "mappings": [ { "id": 147, "name": "Ecommerce", "description": null, "createdAt": "2018-10-16T11:37:36.000Z", "updatedAt": "2019-08-21T07:12:18.000Z" }, { "id": 148, "name": "All pages", "description": null, "createdAt": "2018-10-16T12:49:49.000Z", "updatedAt": "2019-08-21T07:12:23.000Z" } ] }, "success": true}
Zonings
Section titled Zonings/v1/page-groups/{pageGroupId}/zonings
Section titled /v1/page-groups/{pageGroupId}/zoningsGet all the zonings for a page group More information regarding zonings in Contentsquare
Parameters
Section titled ParametersprojectId | Only required for an account-level API key. The target project. |
---|
Example of response
Section titled Example of response{ "payload": [ { "id": 100, "name": "Revamp product page", "createdAt": "2019-10-25T13:12:45.000Z", "lastUpdatedAt": "2019-10-29T11:11:22.000Z" } ], "success": true}
Zones
Section titled Zones/v1/zonings/{zoningId}/zones
Section titled /v1/zonings/{zoningId}/zonesGet all the zones for a zoning More information regarding zonings in Contentsquare
Parameters
Section titled ParametersprojectId | Only required for an account-level API key. The target project. |
---|
Example of response
Section titled Example of response{ "payload": [ { "id": 100, "name": "Add to cart button" } ], "success": true}