### Example JSON Response Source: https://docs.contentsquare.com/en/api/metrics/zone-metrics-endpoints-web/ An example of a successful JSON response structure from the Contentsquare API, containing metric values. ```JSON { "payload": { "values": [ { "startDate": "2021-10-10T22:00:00.000Z", "endDate": "2021-10-17T21:59:59.000Z", "value": 4.808743169398907, "name": "attractivityRate", "device": "desktop", "currency": "USD" } ] }, "success": true } ``` -------------------------------- ### Example API Response Structure Source: https://docs.contentsquare.com/en/api/metrics/zone-metrics-endpoints/ Demonstrates a typical JSON response from a Contentsquare API, detailing payload structure, success status, and metric data like 'timeBeforeFirstClick'. ```json { "payload": { "values": [ { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T17:15:40.261Z", "value": 15.274424150485437, "name": "timeBeforeFirstClick", "device": "desktop", "currency": "USD" } ] }, "success": true } ``` -------------------------------- ### Example JSON Response Source: https://docs.contentsquare.com/en/api/metrics/zone-metrics-endpoints-web/ An example JSON payload demonstrating the structure of metrics returned by the ContentSquare API. It includes an array of metric objects, each containing details like start and end dates, value, name, device, and currency. ```json { "payload": { "values": [ { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 6.033720930232558, "name": "averageRevenueAfterClick", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 10.497237569060774, "name": "avgConversionAfterClick", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 10.9011137360783, "name": "avgConversionAfterHover", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 0.003087246192893401, "name": "avgHoverTime", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 33.472123489387634, "name": "clickRate", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 1.4462985436893203, "name": "clickRepetition", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 104.56852791878173, "name": "engagementRateLive", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 0.5985779733009708, "name": "hesitation", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 32.00974916218137, "name": "hoverRate", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 15.274424150485437, "name": "timeBeforeFirstClick", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 4767, "name": "totalClicks", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 25945, "name": "totalRevenueAfterClick", "device": "desktop", "currency": "USD" } ] }, "success": true } ``` -------------------------------- ### Example JSON Response Source: https://docs.contentsquare.com/en/api/metrics/zone-metrics-endpoints/ An example of a successful JSON response structure from the Contentsquare API, containing metric values. ```JSON { "payload": { "values": [ { "startDate": "2021-10-10T22:00:00.000Z", "endDate": "2021-10-17T21:59:59.000Z", "value": 4.808743169398907, "name": "attractivityRate", "device": "desktop", "currency": "USD" } ] }, "success": true } ``` -------------------------------- ### Example JSON Response Source: https://docs.contentsquare.com/en/api/metrics/zone-metrics-endpoints/ An example JSON payload demonstrating the structure of metrics returned by the ContentSquare API. It includes an array of metric objects, each containing details like start and end dates, value, name, device, and currency. ```json { "payload": { "values": [ { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 6.033720930232558, "name": "averageRevenueAfterClick", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 10.497237569060774, "name": "avgConversionAfterClick", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 10.9011137360783, "name": "avgConversionAfterHover", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 0.003087246192893401, "name": "avgHoverTime", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 33.472123489387634, "name": "clickRate", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 1.4462985436893203, "name": "clickRepetition", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 104.56852791878173, "name": "engagementRateLive", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 0.5985779733009708, "name": "hesitation", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 32.00974916218137, "name": "hoverRate", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 15.274424150485437, "name": "timeBeforeFirstClick", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 4767, "name": "totalClicks", "device": "desktop", "currency": "USD" }, { "startDate": "2021-08-03T00:00:00.000Z", "endDate": "2021-08-11T09:59:03.543Z", "value": 25945, "name": "totalRevenueAfterClick", "device": "desktop", "currency": "USD" } ] }, "success": true } ``` -------------------------------- ### Heap Analytics Initialization Source: https://docs.contentsquare.com/en/webview-tracking-tag/session-replay/ Initializes Heap, a product analytics platform. This snippet loads the Heap script and configures it with an environment ID to start tracking user events. ```javascript // eslint-disable-next-line window.heapReadyCb=window.heapReadyCb||[],window.heap=window.heap||[],heap.load=function(e,t){window.heap.envId=e,window.heap.clientConfig=t=t||{},window.heap.clientConfig.shouldFetchServerConfig=!1;var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://cdn.us.heap-api.com/config/"+e+"/heap_config.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(a,r);var n=["init","startTracking","stopTracking","track","resetIdentity","identify","identifyHashed","getSessionId","getUserId","getIdentity","addUserProperties","addEventProperties","removeEventProperty","clearEventProperties","addAccountProperties","addAdapter","addTransformer","addTransformerFn","onReady","addPageviewProperties","removePageviewProperty","clearPageviewProperties","trackPageview"],i=function(e){return function(){var t=Array.prototype.slice.call(arguments,0);window.heapReadyCb.push({name:e,fn:function(){heap[e]&&heap[e].apply(heap,t)}})}};for(var p=0;p (function () { var mt = document.createElement("script"); mt.type = "text/javascript"; mt.async = true; mt.integrity = "sha512-NEWHASH"; mt.crossOrigin = "anonymous"; mt.src = "//t.contentsquare.net/ss///uxa.js"; document.getElementsByTagName("head")[0].appendChild(mt); })(); ``` -------------------------------- ### Heap Initialization Script Source: https://docs.contentsquare.com/en/android/error-analysis/ This JavaScript code initializes the Heap product analytics platform. It loads the Heap configuration script asynchronously, enabling event tracking and user property management. ```javascript // eslint-disable-next-line window.heapReadyCb=window.heapReadyCb||[],window.heap=window.heap||[],heap.load=function(e,t){window.heap.envId=e,window.heap.clientConfig=t=t||{},window.heap.clientConfig.shouldFetchServerConfig=!1;var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://cdn.us.heap-api.com/config/"+e+"/heap_config.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(a,r);var n=["init","startTracking","stopTracking","track","resetIdentity","identify","identifyHashed","getSessionId","getUserId","getIdentity","addUserProperties","addEventProperties","removeEventProperty","clearEventProperties","addAccountProperties","addAdapter","addTransformer","addTransformerFn","onReady","addPageviewProperties","removePageviewProperty","clearPageviewProperties","trackPageview"],i=function(e){return function(){var t=Array.prototype.slice.call(arguments,0);window.heapReadyCb.push({name:e,fn:function(){heap[e]&&heap[e].apply(heap,t)}})}};for(var p=0;p { ... useEffect(() => { Contentsquare.start(); ... }); ... } ``` -------------------------------- ### JavaScript: Heap Analytics Initialization Source: https://docs.contentsquare.com/en/web/troubleshooting/ Initializes the Heap analytics platform by loading its configuration script. It sets up event tracking, user identification, and session management for product analytics. ```javascript // eslint-disable-next-line window.heapReadyCb=window.heapReadyCb||[],window.heap=window.heap||[],heap.load=function(e,t){window.heap.envId=e,window.heap.clientConfig=t=t||{},window.heap.clientConfig.shouldFetchServerConfig=!1;var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://cdn.us.heap-api.com/config/"+e+"/heap_config.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(a,r);var n=["init","startTracking","stopTracking","track","resetIdentity","identify","identifyHashed","getSessionId","getUserId","getIdentity","addUserProperties","addEventProperties","removeEventProperty","clearEventProperties","addAccountProperties","addAdapter","addTransformer","addTransformerFn","onReady","addPageviewProperties","removePageviewProperty","clearPageviewProperties","trackPageview"],i=function(e){return function(){var t=Array.prototype.slice.call(arguments,0);window.heapReadyCb.push({name:e,fn:function(){heap[e]&&heap[e].apply(heap,t)}})}};for(var p=0;p