Tracking Olark Events in Google Analytics with a Custom Script

If you’re trying to set up custom Olark events inside of Google Analytics or if you’re having problems with the Analytics integration provided by Olark then this script will let you replace the stock integration and have more control over when and what triggers the events.

Inside of Google Analytics, you will see no difference. The script is set up to replace the stock Olark to Google Analytics integration and thus will display the same event categories and actions inside of Google Analytics.

Set Up

This script assumes you’re using Google Tag Manager (GTM) and that Google Analytics is set up via GTM.

Step 1

Create a new GTM variable and name it “event_action” with the following settings:

Variable Type: Data Layer Variable

Variable Name: event_action

Step 2

Create a Tag titled “Olark Listener” (or whatever fits your schema). This tag will listen to the script and send the event information to the GTM variable you created in step 1.

For the tag type use “Custom HTML”. Copy and Paste this html code into the code block inside of the “Custom HTML” tag you just made. Make sure to include <script> and </script> when you copy the code!

For the tag trigger, with a standard set up, use “All Pages”.

Your tag should now look like this:

Step 3

Now, create a 2nd tag and call it “Olark Event Tracker”. This tag will take the information that the “Olark Listener” (Step 2) tag sends to the data layer and send it to Google Analytics.

Step 3a

Set up the tag with the following settings:

Tag Type: Google Analytics: Universal Analytics

Track Type: Event

Category: Olark_Chat

Action: {{event_action}}

The tag should now look like this:

Step 3b

For this tag’s trigger, use trigger type “Custom Event” and name it “Olark Analytics Listener”.

Set up this tag trigger with the following settings:

Event name: Olark_Chat_C

This trigger fires on: Some Custom Events

Conditions: Event | equals | Olark_Chat_C

The trigger configuration should now look like this:

Step 4

Testing time!

Put Google Tag Manager into preview mode and pull up the “events” subpage in the Realtime section of Google Analytics.

Open and close your Olark chat box and you should now see yourself triggering the “Olark Chat” event. Select “Event Action” to confirm that the event action is sending the correct message, which should be “Vistor_Expanded_Olark”.

All done! Let us know what you think of this tutorial using the comment section or contact form below or via the live chat box!

Send Us A Message

More Posts

Production Clicks List of Expectations Shared with New Clients
PPC Agency
jeff

Production Clicks ‘List of Expectations’ Shared with New Clients

One of the most important—if not the most important—part of an agency/client relationship is communication. Especially early communication, when establishing expectations from the very beginning.

It’s important for an agency to listen to their clients and learn about their needs and how they define success.

Read More »
Getting the Most from your WhatConverts Lead Tracking Software
WhatConverts
jeff

Getting the Most from Your WhatConverts Lead Tracking Software

WhatConverts recently—as of 2022—rolled out a new interface for users that includes the Dashboard, Leads, Reports, and Tracking view. Here’s all the information you need to get the most out of your new WhatConverts tracking software.

I have a feeling this new rollout was designed to offer some CRM (Customer Relationship Management) functionality with its robust reporting features, but for the sake of brevity, I’m going to be covering the main takeaways for managing your Google Ads leads from the new interface.

Read More »

Share:

Ready to get started?

Get your PPC proposal today.

After we get your completed form we’ll schedule a meeting with you to go over your goals, your company, and more.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Ready to get started?

Get your PPC proposal today.

After we get your completed form we’ll schedule a meeting with you to go over your goals, your company, and more.