Widget

Set up widget analytics

3min
throughline analytics is only supported for direct requests to your custom subdomain (companyname findahelpline com), using google tag manager (gtm) if no analytics are required, simply embed the widget to enable analytics, you will need to work with your development team to ensure that events being generated by the widget can be consumed by the containing page and sent to your measurement solution what events are available? throughline utilizes the windows\ postmessage https //developer mozilla org/en us/docs/web/api/window/postmessage method to share event data with the parent page below is an example of the event windows parent postmessage( json stringify({ event 'widget click to call' }), ' ' ); the following event types are available 'widget click to call' 'widget click to emergency services' 'widget click to helpline website' 'widget click to online chat' 'widget click to sms' 'widget click to whatsapp' how do we capture the analytics events? add this javascript snippet to capture analytics events and push them to your measure solution window\ addeventlistener( "message", (event) => { if (event origin !== "https //acme findahelpline com") return; if (event data event === 'widget click to call') { // add your code… } }, false );