Chat Events for Analytics Tools

Prev Next

Set up Chat events in GA4

Chat emits events that can be used with analytic tools like Google Analytics for additional analysis. These events can help you better understand how Customers interact with Chat.

Please note that Gladly does not have OOTB reports for these events.

  • Availability:change

  • conversation:ended

  • conversation:started

  • campaign:triggered

  • customer:onboarded

  • message:received

    • Use to answer questions like:

      • Which Agents drove the most revenue?

      • Which Agents had the highest impact on the conversion rate?

  • message:sent

  • quick-action:selected

  • search:result-selected

  • sidekick:closed

  • sidekick:opened

See all events outlined here for more detail, or check out some code samples on Github.

<mark> tags in results

GA4 may return search_result_selected with <mark> tags. These represent a search string within the relevant part of the content, and the API returns the content in this way.

Highlighted terms include Price and Match in search results table.

If you'd like, you can strip the markup before the event is processed. Below is an example that logs to the console that you may repurpose:

Gladly.on('search:result-selected', ([e]) => { let tmp = document.createElement("span"); tmp.innerHTML = e.label; let searchResult = tmp.textContent || tmp.innerText || ""; console.log(searchResult) });