Google Analytics Setup Guide

Configure GA tracking for your S2F chatbot

📊 Overview

This guide explains how to configure your Google Analytics (GA4) or Google Tag Manager (GTM) account to track conversion events from the S2F chatbot. The chatbot script sends tracking data from the user's browser, which must be captured by your analytics setup.

â„šī¸
How the Script Works: The S2F tracking script sends a custom event named s2f_chatbot with specific chatbot interaction details as event parameters (event_action, event_category, event_label).

đŸŽ¯ Chatbot Events Overview

The S2F chatbot tracks the complete customer journey through a series of events. All events are sent with the event name s2f_chatbot and differentiated by the event_action parameter.

Core Conversion Events

The following three primary events track the customer's progression through the booking funnel:

1. Conversation Start
Event Action:
chatbot_conversation_start
When Fired:
When a customer initiates a chat and responds with a non-spam query
2. Booking Details Accepted
Event Action:
chatbot_booking_details_accepted
When Fired:
When customer accepts terms of service and confirms booking details
3. Job Booked
Event Action:
chatbot_job_booked
When Fired:
When booking is successfully created in the system
âš ī¸
Event Naming Note: All events use the same event name s2f_chatbot. The specific action is identified by the event_action parameter. This is important when setting up custom events in GA4.

âš™ī¸ Setup Instructions

1 Configure Google Tag Manager

â„šī¸
For GTM Users Only: Follow the steps in this section if you use Google Tag Manager. If you use GA4 directly on your site, you can skip to Step 2.

Create Data Layer Variables

In GTM, go to Variables → User-Defined Variables → New.
Create a variable for each item below.

GTM Variable: Event Action
Variable Name:
DLV - s2f_chatbot_event_action
Variable Type:
Data Layer Variable
Data Layer Variable Name:
s2f_chatbot_event_model.event_action
GTM Variable: Event Category
Variable Name:
DLV - s2f_chatbot_event_category
Variable Type:
Data Layer Variable
Data Layer Variable Name:
s2f_chatbot_event_model.event_category
GTM Variable: Event Label
Variable Name:
DLV - s2f_chatbot_event_label
Variable Type:
Data Layer Variable
Data Layer Variable Name:
s2f_chatbot_event_model.event_label

Create a Custom Event Trigger

Go to Triggers → New and configure the trigger to fire whenever the chatbot sends an event.

GTM Trigger: Chatbot Event
Trigger Name:
CE - s2f_chatbot Event
Trigger Type:
Custom Event
Event name:
s2f_chatbot
This trigger fires on:
All Custom Events

Create the GA4 Event Tag

Go to Tags → New. This tag will send the collected data to GA4 when the trigger fires.

GTM Tag: Send Chatbot Data to GA4
Tag Name:
GA4 Event - S2F Chatbot
Tag Type:
Google Analytics: GA4 Event
Configuration Tag:
Select your existing GA4 Configuration Tag
Event Name:
s2f_chatbot

Event Parameters:
Parameter: event_action
{{DLV - s2f_chatbot_event_action}}
Parameter: event_category
{{DLV - s2f_chatbot_event_category}}
Parameter: event_label
{{DLV - s2f_chatbot_event_label}}

Firing Trigger:
Select Trigger:
CE - s2f_chatbot Event

2 Create Custom Dimensions in GA4

âš ī¸
Mandatory for All Users: This step is required for everyone, whether you use GTM or a direct GA4 installation. Without this, your chatbot data will be less useful in reports.

In your GA4 property, go to Admin → Data display → Custom definitions and click Create custom dimensions.

Create the three event-scoped dimensions below exactly as shown.

Dimension 1: Event Category
Dimension name:
event_category
Scope:
Event
Event parameter:
event_category
Dimension 2: Event Action
Dimension name:
event_action
Scope:
Event
Event parameter:
event_action
Dimension 3: Event Label
Dimension name:
event_label
Scope:
Event
Event parameter:
event_label

3 Set Up Key Events in GA4

To track conversions effectively, you'll need to create custom events in GA4 based on the event_action parameter values.

Create Custom Events

Navigate to Admin → Events, then click Custom Configurations → Custom Events → Create. Choose "View More Options" and create the following events:

Event 1: S2F_Chat_Start
Custom Event Name:
S2F_Chat_Start

Matching Conditions:
Condition 1:
event_name equals (ignore case) s2f_chatbot
AND
Condition 2:
event_action equals (ignore case) chatbot_conversation_start
Event 2: S2F_Chat_DetailsAccepted
Custom Event Name:
S2F_Chat_DetailsAccepted

Matching Conditions:
Condition 1:
event_name equals (ignore case) s2f_chatbot
AND
Condition 2:
event_action equals (ignore case) chatbot_booking_details_accepted
Event 3: S2F_Chat_Booked
Custom Event Name:
S2F_Chat_Booked

Matching Conditions:
Condition 1:
event_name equals (ignore case) s2f_chatbot
AND
Condition 2:
event_action equals (ignore case) chatbot_job_booked

Mark as Key Events

After creating the custom events:

  1. Go to Events → Recent Events
  2. Find each custom event you created
  3. Click the star icon next to each event to mark it as a Key Event
  4. Click the three dots menu next to each event and change the counting method to "Once Per Session"
â„šī¸
A2O Marketing Customers: Unless otherwise instructed, please set up S2F_Chat_Start and S2F_Chat_Booked as Key Events at minimum.

4 Import to Google Ads (Optional)

Once your Key Events are set up in GA4, you can import them into Google Ads for conversion tracking:

  1. In Google Ads, navigate to Tools & Settings → Conversions
  2. Click the plus button to add a new conversion
  3. Select "Import" → "Google Analytics 4 properties"
  4. Select your GA4 property and the Key Events you want to import
  5. Configure conversion settings (counting, value, attribution) as needed
✓
Best Practice: Import both S2F_Chat_Start (for engagement tracking) and S2F_Chat_Booked (for conversion tracking) to optimize your Google Ads campaigns effectively.

✅ Verification Steps

After implementation, verify your tracking is working correctly:

1. Test the Chatbot
Initiate a test conversation with the chatbot on your website. If using GTM, have Preview Mode open.
2. Check Real-time Reports or DebugView
In GA4, navigate to Reports → Realtime or Admin → DebugView.
You should see the s2f_chatbot event appear with the appropriate event_action values.
Click on events to verify parameters are being collected correctly.
3. Verify Custom Events
After 24 hours, check that your custom events (S2F_Chat_Start, etc.) are appearing in your Events report.
✓
Success! Once you see events in your Real-time reports and custom events are being created, your tracking is properly configured.