Sportsbook Analytics
How to Install
Use Google Analytics Setup guide in order to create a snippet for your HUB2.
Integrate
Create a Custom JS
snippet in Tag Manager
with the following contents:
(() => {
let page;
let userName;
function gtag() {
window.dataLayer?.push(arguments);
}
Playtech.on('sportsbook-analytics', ({ detail: event }) => {
if (event.userName !== userName) {
userName = event.userName;
gtag('set', { userId: userName });
}
if (event.page !== page) {
page = event.page;
gtag('set', { page: page });
}
gtag('event', event.eventName, event.data);
});
})();
Add On Application Initialisation
condition, activate and make the tag as Ready for Publishing
.