Skip to main content

Analytics Integration

Integrating with Google Analytics

C
Written by Chris LaMorte
Updated over 9 months ago

Currently you are able to track contact form submissions.

Step 1: Add Google Tag Manager (or your preferred analytics)

First, include your analytics code in your website's header:

Copy<!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&dataLayer='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXXXXXX');</script> <!-- End Google Tag Manager -->

Step 2: Add the Chatbot Embed Script

Place your chatbot embed script on your webpage:

Copy<!-- Chatbot widget --> <script src="https://app.strictly.ai/widget/chat-embed.js" data-chatbot-id="YOUR_CHATBOT_ID"> </script>

Step 3: Add the Analytics Tracker Script

Add the analytics tracker script AFTER your chatbot embed script:

Copy<!-- Analytics tracking for chatbot --> <script src="https://app.strictly.ai/scripts/analytics-tracker.js" data-chatbot-id="YOUR_CHATBOT_ID" data-tracking-type="ANALYTI" data-debug="false"> </script>

Configuration Options

Attribute

Description

Values

data-chatbot-id

The ID of your chatbot (must match the chatbot embed script)

Required, string

data-tracking-type

Which analytics platform to use. UA is recommended.

Optional - defaults to "gtm" Options: "gtm" (Google Tag Manager), "ga4" (Google Analytics 4), "ua" (Universal Analytics)

data-debug

Enable console logging for debugging

Optional, defaults to false Options: "true", "false"

Step 4: Set Up in Google Analytics

In Google Analytics 4, go to your Admin Panel. Then:

  1. Navigate to ‘events’.

  2. Click on ‘Create Event’.

  3. Use the following custom event names to track events properly:
    a) Use event_name = contact_form_conversion to track submissions.
    b) Use event_name = contact_form_start to track those who start the form.

Did this answer your question?