Google Analytics
Send chat events to Google Analytics
Chat events are written into the Google Analytics or Tag Manager setup already running on your site: chat opened, conversation started, contact details left. All you do is turn on a switch.
Before you start
- Google Analytics 4 or Google Tag Manager already installed on your site
- An owner account that can open the site settings
Steps
Turn on the switch
Settings → Websites → pick your site → Install tab. Turn on "Send events to Google Analytics" at the bottom. No measurement ID is asked for: Lunachat does not load its own Google script, it writes into the setup already running on your page.
The switch is per site. If your main site has Analytics and your outlet store does not, leave it off on the second one.
Know which events are sent
Five events, all prefixed with lunachat_: lunachat_chat_opened (the visitor opened the chat window), lunachat_conversation_started (the first message created a conversation), lunachat_message_sent (another message in the same conversation), lunachat_lead_captured (the visitor left contact details), lunachat_rating_submitted (the satisfaction survey was answered, with a single score parameter from 1 to 5).
Find the events in GA4
In Google Analytics go to Admin → Data display → Events. New events can take up to 24 hours to appear in that list; if you do not want to wait, start a chat on your site and watch it land in Reports → Realtime.
To count one as a conversion, use the "Mark as key event" toggle on the right of the same list. lunachat_lead_captured is the right pick for most businesses.
If you use Tag Manager
When gtag.js is not on the page but Tag Manager is, events go into the dataLayer. In Tag Manager create a Data Layer Variable for the event name, build a trigger on it and attach your GA4 event tag.
Frequently asked
Related guides
No account yet?
The free plan covers 2 users and 200 conversations a month. No credit card.