I am working with Sitecore 10 and CDP. I have created a custom web template in Sitecore CDP and trying to track all user Activity. Previously it worked fine, but now it doesn't track the user activity. I have added the below script in to the layout file and track the Identity event from custom Template API.
Can anyone help me to solve this?
<script type="text/javascript">
// Define the Boxever queue
var _boxeverq = _boxeverq || [];
_boxeverq.push(function () {
var viewEvent = {
"browser_id": Boxever.getID(),
"channel": "WEB",
"type": "VIEW",
"language": "EN",
"currency": "EUR",
"page": window.location.pathname,
"pos": "xxx"
};
//Add UTM params
viewEvent = Boxever.addUTMParams(viewEvent);
// Invoke event create
// (<event msg>, <callback function>, <format>)
Boxever.eventCreate(viewEvent, function (data) { }, 'json');
});
// Define the Boxever settings
var _boxever_settings = {
client_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx', //Replace with your client key display in screen shot
target: 'https://api.boxever.com/v1.2', // Replace with your API target endpoint specific to your data center region
cookie_domain: 'xxx.dev.local', //Replace with the top level cookie domain of the website that is being integrated
pointOfSale: "xxxx", //Replace with newly created POS
};
// Import the Boxever library asynchronously
(function () {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://d1mj578wat5n4o.cloudfront.net/boxever-1.4.8.min.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
</script>