Skip to main content
This page lists the events Totebot sends to Google Analytics and Meta, the data each event carries, and how to use the events on your own website. No personal data is sent. Totebot never sends message text, names, email addresses or phone numbers.

Event list

Events without a Meta event are only available for Google Analytics.

Parameters

Every event carries: Some events carry extra parameters: Each product in items can have item_id, item_name, price, quantity, item_brand, item_variant and, for view_item_list, index (its position in the reply). Fields are only included when Totebot knows them.

Data layer format

With the Through my website’s Google tag or Both delivery mode, the embed script on your page receives each event from the chat widget and does two things:
  1. Pushes it into window.dataLayer.
  2. Calls window.gtag if your page has it.
For ecommerce events, the script first clears the previous ecommerce object, then pushes the event:
item_list_name sits inside ecommerce. search_term and lead_source sit at the top level. Keys are only present when they have a value. The gtag call looks like this:
send_to is the Measurement ID you entered in Totebot, so the event only goes to that GA4 property.

Tracking options

You can turn off either output. Set window.totebotTrackingOptions on your page, before or after the embed script:
If you use gtag.js without Google Tag Manager, you don’t need to set anything.

Send events to other tools

The embed script also exposes the events in JavaScript, so you can forward them to any analytics tool. Listen with window.totebot.on('event', callback):
Stop listening with window.totebot.off('event', onTotebotEvent). window.totebot exists once the embed script has loaded. If your code may run earlier, listen for the totebot:event browser event instead. It carries the same object in event.detail:
The callback fires for every event you ticked in the Google Analytics integration, on the web widget, when the delivery mode is Through my website’s Google tag or Both. It runs in the shopper’s browser, so it never fires for WhatsApp, Telegram or email chats.
Totebot events contain no personal data. Keep it that way: don’t add names, email addresses, phone numbers or message text when you forward events to another tool.