That’s frustrating when a reliable setup suddenly stops working.
It sounds like Tawk.to may have recently changed how their front-end JavaScript or the chat widget itself operates, which is a common reason for custom GTM setups based on front-end events to break.
The event listener for the visitor message - Tawk_API.onChatMessageVisitor
- might no longer be reliably firing or its timing has shifted, making it unavailable when your GTM tag attempts to listen.
I haven’t experienced this specific issue with Tawk.to recently, but generally, when a front-end event breaks, the most robust and future-proof solution is to shift to a server-side tracking approach.
This involves using the Tawk.to dataLayer events you already have, sending those to a service like Stape or Google Cloud Platform, and then utilizing the Google Ads API to send the conversion data directly to Google Ads.
This is generally a much better long-term solution because it relies on Tawk.to’s own API functions, which are less likely to change or break than trying to trigger off of an element or a subtle front-end event.
You can still use the script you shared to push the events to the dataLayer.
Specifically, you’d configure your GTM to listen for your custom event - tawkto_Interactions
- and then send that data to a server container using a service like Stape.
In the server container, you would process the event and then send it to Google Ads using a Google Ads tag with the conversion events you want to track, like the visitor message event.
The benefit of this is that server-side tracking using the Google Ads API is less susceptible to ad blockers and browser limitations like Intelligent Tracking Prevention (ITP).
Plus, server-side tracking allows you to send events that Google considers Standard Events, such as purchase
, lead
, or sign_up
, which are crucial for effective campaign optimization, instead of solely relying on the non-standard chat started
event.
This way, you ensure your tracking is both accurate and resilient against future front-end changes.