Sales tracking connects your store’s purchase and cart activity to Text conversations, so agents can see orders and cart updates in real time. Sales data also feeds into your ecommerce reports, letting you measure revenue driven by chat and AI agents.
This integration is built for custom ecommerce platforms like Adobe Commerce, SAP Commerce Cloud, Salesforce Commerce Cloud, headless storefronts, and custom-built stores. Your developers only need to add a few JavaScript calls — no plugins, connectors, or backend setup required.
What do you need?
A Text account with a connected website
The Chat Widget installed on your store — including on checkout and order confirmation pages, since that's where purchase events need to fire
If you'd rather not add tracking code to your storefront directly, you can fire the same events from Google Tag Manager instead. See Set up sales tracking with Google Tag Manager below.
How does it work?
Sales tracking works by sending ecommerce events from your store to Text through the Chat Widget JavaScript API. Your developer adds JavaScript calls at key moments in the customer journey — for example, when a product is added to the cart or when an order is completed.
Use the following method to send events from your storefront:
LiveChatWidget.call('track_sales_event', { name: '...', data: { ... } })The widget automatically attaches customer identity and page details, then sends the data to Text in real time. Agents instantly see cart and purchase activity inside the Inbox, while sales data is added to your ecommerce reporting and revenue attribution.
This integration requires no plugins, API keys, authentication headers, or backend development, making it ideal for custom ecommerce platforms, headless storefronts, and enterprise commerce solutions.
For implementation details, supported event types, payload structure, and required fields, see the Sales Tracking JS API reference for custom ecommerce integrations.
What do you get?
Real-time visibility for agents
When a customer chats with your team, agents can see:
Order notifications — the moment a purchase is completed, the agent sees the order number, total value, and items bought, directly in the chat
Order details in the sidebar — agents can view recent and past orders, total orders and spend, and purchases made during or after the chat directly alongside the conversation for quick reference.
Wins counter –– a top-bar counter visible for all agents working in Text. Updates whenever someone from the team makes an order. Refreshes every day.
This means your agents never have to ask "did you end up placing that order?" or switch to another tool to check. The context is right there.

Sales reporting
Every tracked order feeds into two reports in Text:
All Sales — shows all orders placed during a chat or within 30 days after a chat, whether the conversation was handled by a human agent or an AI agent. You see total revenue, number of orders, and average time from chat to purchase.
AI Agent Sales — the same metrics, filtered to show only sales attributed to AI agent conversations. Use this to measure your AI agent's direct impact on revenue.
Learn more about ecommerce reports, sales attribution, and revenue tracking.Add sales tracking to your website
Track completed orders
This is the core of the integration. When a customer completes a purchase, fire the order event from your order confirmation page.
Example:
LiveChatWidget.call("track_sales_event", {
name: "store_order_was_created",
data: {
order: {
id: "1042",
order_number: "#1042",
currency: "USD",
total_price: 149.99,
line_items: [
{
product_id: "123456789",
title: "Merino Wool Crew Neck",
quantity: 1,
price: 149.99,
},
],
},
},
});For the full list of required and optional parameters, see the Sales Tracking JS API reference for custom ecommerce integrations.
What does the agent see?
The agent receives an order notification in the chat, including the order number, total value, and a list of items with product images, titles, quantities, and prices. Order details are also available in the sidebar.

How does this connect to reports?
The order appears in the All Sales report and, if the chat was handled by an AI agent, in AI agent Sales. The attribution window is 30 days from the chat. Report data syncs daily, so the order will appear in reports the next day.

Set up sales tracking with Google Tag Manager
If you can't add JavaScript to your storefront directly — or you'd rather manage tracking code outside your theme — you can fire sales events from Google Tag Manager (GTM) instead. GTM sends the same track_sales_event call as a hard-coded implementation, so agent notifications, sidebar order details, and ecommerce reports all work identically.
This is the usual route for merchants on platforms without a native Text e-commerce connector, including custom and headless storefronts, where checkout and confirmation templates are difficult to edit safely
Before you begin
Make sure you have:
A Google Tag Manager account, with a container already installed on your storefront — or the access needed to install one
The Chat Widget loaded on your order confirmation page. The track_sales_event call runs through the widget, so it does nothing if the widget isn't on the page. You can install the widget through GTM too — see connecting the website widget using GTM.
Access to your order confirmation data — order ID, order number, total, and currency — either from the page's dataLayer or from variables your platform exposes
Step 1: Create the tag
In your GTM workspace, create a new Custom HTML tag containing the track_sales_event call that sends order data to Text. Use the same payload structure as a direct implementation, described in the Sales Tracking JS API reference.
Step 2: Map your order data
Populate the order fields from GTM variables rather than hard-coding them. You have two options:
Data Layer variables — if your platform pushes order details to the dataLayer on the confirmation page, create a Data Layer Variable for each field. This is the preferred approach, since the values come straight from the order.
Platform-specific variables — if your platform doesn't expose a dataLayer, use the variables available in your platform's own template or script context.
Step 3: Restrict the trigger to your confirmation page
This is an important step - create a trigger scoped tightly to your order confirmation or thank-you page — for example, a Page View trigger with a Page URL condition that matches only the confirmation path.
A trigger that fires anywhere else will send events for orders that never happened, or send the same order more than once. A confirmation page that a customer reloads can also re-fire the tag. Narrow the trigger before you publish.
Step 4: Publish the container
Submit and publish your GTM container. Changes saved in a workspace don't reach your live store until you publish them.
If the container isn't on your storefront yet, add the GTM snippet to your store's header so it loads on all pages, including checkout and confirmation. How you do this depends on the platform — a script manager, a theme template file, or a custom HTML field. On BigCommerce, for example, add it through Script Manager with Location set to All pages and Placement set to Header.
Step 5: Place a test order
Place a test order in your store.
Open GTM's Preview mode and walk through checkout. Confirm the tag fires once, on the confirmation page only, and doesn't fire elsewhere.
Check the agent's Inbox — the order notification should appear within seconds.
Check the All Sales report the next day and confirm the order value matches your test order.
How to test your integration?
You don't need a special test mode. Here's how to verify everything works:
Open your store in a browser where the Chat Widget is loaded
Start a chat conversation (or ensure one is already active)
Trigger an event — place a test order or add a product to the cart
Check the agent's Inbox — the notification should appear in the chat feed within seconds
Check your browser console — if required fields are missing or the payload is invalid, the widget logs a warning
The next day, verify that the test order appears in the All Sales report.
Troubleshooting
Order events not appearing in the Inbox
Is the Chat Widget loaded on the page where the event fires? It needs to be present on checkout and confirmation pages, not just the storefront.
Does the page hostname match a connected website in your Text account? Events sent from a hostname that isn't connected are dropped, so check your list of connected sites in Settings → Website widgets.
Are all required fields present? Check the browser console for warnings.
Events not firing from Google Tag Manager
Start in GTM's Preview mode before contacting support. It shows whether the tag fired at all and which trigger fired it — a trigger that never matched the confirmation URL is the most common cause.
Confirm the container is published, not just saved in your workspace.
Confirm the Chat Widget loads on the confirmation page before your tag fires. The track_sales_event call depends on the widget already being present.
Orders not appearing in reports
Report data syncs once per day. Check the following day.
If the order doesn't appear in the Inbox, it won't appear in reports either. Start by troubleshooting Inbox visibility first.
Seeing duplicate orders
Check that your integration fires the event only once per order. Common causes: page reloads on the confirmation page, SPA re-renders, or the event firing in both a page-load handler and a callback.
If you're using GTM, a trigger that isn't restricted to the confirmation page is the usual cause. Check the trigger conditions before anything else.
Getting a 422 error
The payload failed validation. The response body includes an error_code and message explaining what's wrong. Common causes: missing a required field, using an unrecognized event name, or a malformed data object. See the JS API reference for the full payload specification.
Getting a 429 error
You've hit the rate limit. This can happen on high-traffic stores. There's no retry mechanism built into the widget — the event is dropped. If this happens consistently, contact support.
Frequently asked questions
Yes. While the integration is called "sales tracking," the event structure can represent any conversion. For example, if your business tracks deposit payments, you can fire the order event when a deposit is confirmed. The agent sees it as a completed transaction attributed to the chat, and it appears in your sales reports.
Google Tag Manager lets you add and change the tracking call without touching your theme, as long as a GTM container is already installed on your storefront. Installing the container itself is a one-time change to your store's header, which you may be able to make through a script manager rather than a template file.
No — the opposite. This integration exists specifically for stores that don't have a native platform connector. If you do use Shopify, see Connecting the website widget using Shopify instead.
Yes, this API is also dedicated for headless commerce. In this case, you should integrate via this API, not the standard Shopify integration.
Include the thumbnail_url field for each line item — this should be a direct URL to the product image (JPEG, PNG, or WebP). The agent sees it as a thumbnail next to the product name in the order details. If you don't provide an image URL, a placeholder is displayed. The image is loaded directly from your URL, so make sure it's publicly accessible.
Orders appear in the agent's Inbox in real time (within seconds). Report data syncs once per day, so orders show up in All Sales and AI Agent Sales the following day.
No, order events are automatically deduplicated on our side.
What's next
Ecommerce reports — learn how to read and filter your sales reports
Sales tracking JS API reference — full technical documentation with payload specifications and event names