# Google Analytics

You can track your chatbot conversations via Google Analytics or GA4 easily in
Collect.chat. This will help you understand how visitors are interacting with
the chatbot. Here are the steps to push the data into Google Analytics.


GET THE TRACKING ID

Login to Google Analytics and choose Setup Assistant under Admin (Gear-shaped
icon).



Click on the check mark next to Collect website and app data, then click on
Manage data streams.



Choose your stream from the list.



Copy the Measurement ID.




PASTE THE TRACKING ID

Go to your dashboard and choose your desired chatbot. Click on Edit
> Integrations to see all integration options. Choose Google Analytics.

Paste the tracking ID and click on Save.






TEST EVENT CREATION

Go to your Website. Start chatting with your chatbot a couple of times.




REAL TIME EVENTS

Collect.chat creates three types of Events for every conversation. The Event
Category for all three Events will be the unique ID of the chatbot.

The Event Action for these three are:

 1. CollectChatView This event is triggered whenever the chatbot is loaded on
    the page. This event is triggered without particular user action, and hence
    it will be recorded as a non interaction event
    [https://developers.google.com/analytics/devguides/collection/analyticsjs/events#non_interaction_events].

 2. CollectChatStart - This event is triggered when the conversation begins.

 3. CollectChatComplete - This event is triggered when the conversation ends
    completely.

On your Google Analytics Dashboard, go to Reports > Realtime to see these events
live as you are testing.






TRACK THE EVENTS

The details of all the Events can be found under BEHAVIOUR > Events. You can use
these Events to create Goals in Google Analytics. This can help you to track
conversions. Read this guide
[https://support.google.com/analytics/answer/1032415?hl=en#create_or_edit_goals] from
Google Analytics to learn how to set up Goals.