Try Omnifox free 7 days free. No credit card required.
Guides

GA4 and Your Website Chat: Tracking Opens, Conversations and Conversions With dataLayer

The widget pushes events to the dataLayer and gtag: widget_opened, conversation_started, message_sent. How to see them in GA4 and mark key events.

September 11, 2026
GA4 and Your Website Chat: Tracking Opens, Conversations and Conversions With dataLayer
In this article

    Marketing teams spend on ads, watch sessions climb in GA4, and still cannot answer a simple question: which campaign produced the chats that turned into customers? The gap exists because the website chat lives in one tool and the analytics live in another. Connecting GA4 and your website chat closes that gap, and with the Omnifox widget most of the work is already done: the four widget events are pushed to your site's dataLayer and to gtag automatically whenever those objects exist on the page.

    What follows is the practical side: how to confirm the events are arriving, how to turn conversation_started into a key event, how to explore which pages and campaigns drive chats, and how to avoid the classic mistake of counting everything twice when Google Tag Manager is also involved.

    What the widget sends to the dataLayer and gtag

    The widget records four events and sends each one twice: once to Omnifox (where they build the widget funnel in the dashboard) and once to your page, if it finds window.dataLayer or window.gtag.

    Event name Fires when Typical use in GA4
    widget_loaded The chat button rendered on the page Reach; usually not a key event
    widget_opened Visitor opened the chat panel Engagement, remarketing audiences
    conversation_started A conversation record was created Key event (conversion)
    message_sent Visitor sent a message Engagement depth

    Nothing needs to be configured on the widget side. If your GA4 tag is installed directly with gtag.js, the events go straight to GA4. If it is installed through Google Tag Manager, the events land in the dataLayer and you decide in GTM whether to forward them.

    Step 1: confirm the events arrive in DebugView

    Before building reports, prove the plumbing works.

    1. Open your site in a browser with the Google Analytics Debugger extension enabled, or append ?debug_mode=true to a test URL if your tag setup supports it.
    2. In GA4, go to Admin → DebugView and pick your device from the list.
    3. Load a page with the widget. You should see widget_loaded appear in the timeline.
    4. Click the chat button: widget_opened. Get past the pre-chat form: conversation_started. Type and send: message_sent.

    If you see nothing, open the browser console and type dataLayer or gtag. If both are undefined, the analytics tag is not on that page or loads after the widget; check the tag's order and scope. If you see the events in dataLayer but not in DebugView, the missing link is inside GTM (next section).

    Google's own reference for this screen is the DebugView help article.

    Step 2: with GTM, forward once, not twice

    This is where most double-counting starts. Two situations:

    Your GA4 configuration tag lives in GTM and there is no direct gtag.js on the page. Then window.gtag does not exist, the widget pushes only to dataLayer, and GA4 sees nothing until you create a tag. Do it once:

    • Trigger: Custom Event, event name conversation_started (repeat for widget_opened and message_sent if you want them).
    • Tag: Google Analytics: GA4 Event, event name identical to the trigger.
    • Publish the container and re-check DebugView.

    Both gtag.js and GTM are on the page. Now the widget pushes to both objects. Do not build the GTM tags above, or every chat will count twice. Pick one path and delete the other.

    A quick way to verify: in DebugView, one click on the chat button should produce exactly one widget_opened. If you see two, you have both paths active.

    Step 3: mark conversation_started as a key event

    A key event is what GA4 formerly called a conversion. The steps:

    1. Wait until the event has fired at least once, so it appears in the list.
    2. Go to Admin → Events (under Data display).
    3. Find conversation_started and toggle Mark as key event.

    From then on, every standard acquisition report can show chat conversations per source, medium and campaign, exactly like a form submission or a purchase. Many teams stop here and it is already a big improvement; you can see at a glance that a paid social campaign sends plenty of sessions but no chats, while an organic comparison article sends fewer sessions and more conversations.

    Whether widget_opened deserves key-event status depends on your volume. On a low-traffic B2B site, an open is a meaningful signal. On a high-traffic retail site, it is mostly curiosity; keep it as a regular event and use it for audiences instead.

    Step 4: explore which pages and campaigns drive chats

    The Reports section answers "how many". The Explore section answers "from where and after what".

    A useful funnel exploration:

    • Steps: page_view → widget_opened → conversation_started → message_sent.
    • Breakdown: page_location or session_source / medium.
    • Make the funnel open, so visitors who arrived on a landing page and chatted from a later page still count.

    A second exploration worth building is a free-form table with landing page as the row and conversation_started as the metric. It shows the page that started the session, which is not always the page where the chat happened; a visitor may land on a blog article and chat from the pricing page.

    If you want to understand the healthy shape of those numbers before optimizing, the companion post on the website chat funnel and what a normal rate looks like walks through each drop.

    Step 5: build a remarketing audience from opens without purchases

    GA4 audiences can be shared with Google Ads. A classic one for this setup:

    Audience: Opened chat, no purchase (30 days) Include users when: widget_opened event count ≥ 1 Exclude users when: purchase event count ≥ 1 (or generate_lead, if that is your goal) Membership duration: 30 days

    You can also create a narrower audience from conversation_started without a later purchase. Those are people who cared enough to write; a follow-up ad that references the question they had ("Still comparing plans? Here is the side-by-side") tends to make more sense than a generic brand ad. Compliance around remarketing and consent varies by region (GDPR and UK GDPR in particular), so confirm your consent banner covers analytics and advertising cookies with your own counsel.

    Step 6: close the loop in the CRM

    GA4 tells you which campaign produced a conversation_started. It cannot tell you whether that conversation became a customer, because it never sees the inbox. Omnifox stores the origin page, the referrer and the UTM parameters on each conversation and carries them onto the contact record in the CRM. That gives you the second half of the picture:

    Question Where to look
    Which campaign generated the most chats? GA4, acquisition reports with conversation_started as key event
    Which pages make people open the chat? GA4 Explore, funnel by page_location
    Which campaign generated chats that became deals? CRM, filter contacts by UTM campaign, look at pipeline stage
    Which conversations left no email or phone? CRM, contacts without identifiers, by source page

    When a visitor also signs in to your product, window.Omnifox.identify with an HMAC hash from your backend links the chat to the known user, so the campaign that brought them and the account they now own sit in the same record.

    Frequently asked questions

    Do I need to write code to send widget events to GA4?

    No. The widget pushes widget_loaded, widget_opened, conversation_started and message_sent to dataLayer and gtag automatically when those objects exist. You only add a GTM tag if your GA4 is installed exclusively through Tag Manager.

    Which chat event should be a key event in GA4?

    conversation_started is the safest choice because it marks the moment a real conversation exists in your inbox. Use widget_opened for audiences and engagement, not as a conversion, unless your traffic is very low.

    Why do my chat events appear twice in GA4?

    You have both a direct gtag.js installation and a GTM tag forwarding the same custom events. Remove one of the two paths and re-test in DebugView until one click produces one event.

    Can I see the campaign of each chat in the inbox?

    Yes. Each website chat conversation stores the origin page, the referrer and the UTM parameters, and they are visible on the contact record in the CRM alongside the full conversation history.

    Measure the chat like any other conversion

    Once conversation_started is a key event and the UTM data flows into the CRM, your website chat stops being a black box and becomes a channel you can budget for. The events are already in the Omnifox website chat widget on every plan, with no extra tracking code. Start a 7-day free trial, install the one-line script, and check DebugView the same afternoon.

    Ready to try it in your business?

    Bring WhatsApp, Instagram, Messenger, email and calls into one inbox, and let AI handle the first reply. Set it up today.

    7 days free. No credit card required.

    Comments (0)

    No comments yet. Be the first to share your thoughts.

    Leave a comment

    Your email is never published. Comments are moderated before appearing.

    Markdown supported. HTML is stripped.

    Read more

    Message us on WhatsApp