Tracking Widget Clicks and Messages as Conversions

The TailorTalk chat widget and WhatsApp widget send their clicks and messages to the Google and Meta tags already on your website. You don't need to add any extra scripts. Each time a visitor clicks the widget or sends a message, the event goes to your Google tag or Google Tag Manager and to your Meta Pixel. You can then mark these events as conversions in Google Ads and Meta campaigns.

Events

Event Widget When it fires How often
tailortalk_widget_click Chat and WhatsApp A visitor clicks the widget button. Every click
tailortalk_message_sent Chat A visitor sends a message in the chat. Every message
tailortalk_message_sent WhatsApp A visitor is taken to WhatsApp to start the chat. Every time
whatsapp_click WhatsApp A visitor starts a WhatsApp chat. Sent to Meta as the standard Contact event. Once per visitor session

Every event includes these parameters:

Parameter Description
widget chat or whatsapp
agent_id Your TailorTalk agent ID
first_message Only on tailortalk_message_sent. true for the visitor's first message in the session, false after that.

Which event should be my conversion?

  • WhatsApp widget: use whatsapp_click (in Meta, the Contact event). It counts each visitor once per session, so repeat clicks don't inflate your conversions.
  • Chat widget: use tailortalk_message_sent where first_message is true. It counts a visitor once, when they start a conversation.

Where the Events Go

Your website has What TailorTalk sends
Google Tag Manager Each event is pushed to the dataLayer under its event name.
Google tag (GA4 or Google Ads), without Google Tag Manager gtag('event', ...) with the event name.
Meta Pixel fbq('trackCustom', ...) with the event name. whatsapp_click is sent as fbq('track', 'Contact').

If your site has both Google Tag Manager and the Google tag, the events go to Google Tag Manager only, so GA4 never counts the same click twice.

Set Up a Google Ads Conversion

If you use the Google tag (GA4)

  1. Open your website, click the widget and send a message or start a WhatsApp chat.
  2. In GA4, go to Admin → Data display → Events. The event (for example whatsapp_click) appears there, which can take up to 24 hours.
  3. Mark the event as a key event.
  4. In Google Ads, go to Goals → Conversions → New conversion action → Import → Google Analytics 4 properties and select the event.

If you use Google Tag Manager

  1. In Google Tag Manager, create a trigger: Trigger type: Custom Event, Event name: whatsapp_click (or tailortalk_message_sent).
  2. For the chat widget, add a condition on first_message equals true if you only want to count a visitor's first message. To use first_message in a trigger condition, first create a Data Layer Variable for it.
  3. Attach the trigger to your Google Ads Conversion Tracking tag (or a GA4 event tag).
  4. Publish your container.

Direct Google Ads conversion (optional)

To fire a Google Ads conversion directly when a visitor starts a WhatsApp chat, add your conversion ID and label to the WhatsApp widget code:

window.TailorTalkWhatsApp.init({
  // ...your existing settings
  googleAdsConversion: "AW-123456789/AbCdEfGhIj"
});

You can find the conversion ID and label in Google Ads under Goals → Conversions → your conversion action → Tag setup → Use Google tag. This works when the Google tag is on your site without Google Tag Manager.

Set Up a Meta Conversion

  1. Make sure the Meta Pixel is installed on your website.
  2. Open your website, click the widget and send a message or start a WhatsApp chat.
  3. In Meta Events Manager → Test Events, check that the event appears:
    • WhatsApp widget: Contact
    • Chat widget: tailortalkmessagesent
  4. WhatsApp widget: in your campaign, choose Contact as the conversion event.
  5. Chat widget: create a Custom Conversion in Events Manager based on the tailortalk_message_sent event (add the rule first_message equals true to count first messages only), then choose it in your campaign.

Test Your Setup

  • Google tag: use GA4 → Admin → Data display → DebugView, or Google Tag Assistant.
  • Google Tag Manager: use Preview mode and check that the event appears in the dataLayer.
  • Meta Pixel: use Events Manager → Test Events, or the Meta Pixel Helper browser extension.

Clicks made while you preview the widget in the TailorTalk dashboard are never reported.

Other Analytics Tools

Each event is also dispatched on the page window under the same name, so any other tool can listen for it:

window.addEventListener("tailortalk_message_sent", function (event) {
  console.log(event.detail); // { widget: "chat", agent_id: "...", first_message: true }
});

Turn Off Event Tracking

To stop the widget from sending events to your tags, add conversionTracking: false to the widget code:

TailorTalk.init({
  // ...your existing settings
  conversionTracking: false
});

For the WhatsApp widget, add the same setting to window.TailorTalkWhatsApp.init({ ... }).

XLinkedIn