Event tracking with Chat-Widget

What’s Event Tracking?

Event tracking lets you record user actions in your app/website (e.g., "Button Clicked," "Product Viewed"). Tracking events in Intercom gives you a better understanding of how your customers use your product.

Let’s break it down 👇



✅ What’s Automatically Tracked?

Out of the box, your chat-widget automatically tracks:

  • 🌐 Page visits

  • 🏷️ Domain activity

This means whenever a user visits your site, their activity is logged without you needing to do anything.

All this data is stored safely in Segmento, ready for you to analyze.


✍️ How to Track Custom Events

If you want to track something specific (like when a user clicks "Add to Cart" or views a product), you can do that with a simple JavaScript call:

🔧 Method:

window.chatWidget.addUserEvent({  event_name: 'custom_event_name',  ...addition JSON data});

Note: Data should be in the JSON format.

📝 Example:

window.chatWidget.addUserEvent({
  event_name: 'viewed_product',
  product_id: 123,
  product_name: 'Super Comfy Chair',
  category: 'Furniture'
});

This will send the event data to Segmento under the user’s profile, where you can use it for insights, automation, or support.



🛠 Tips

  • Use clear event names like started_checkout, opened_pricing_page, or clicked_subscribe_button.

  • You can send any extra data (like product name, category, or user plan) along with the event.

  • Make sure your custom events are added after the chat-widget is loaded.


📁 Where Does the Data Go?

All your event data is stored in Segmento.

Click on any row, you will see all the events for that. user

Screenshot 2025-08-06 at 11.01.42 AM.png

This means:

  • You can view detailed activity for each user.

  • Set up automations or filters based on what users do.

  • Use the data to improve support or marketing.