Barilliance supports two types of integration with Google Analytics (GA). Campaign tracking using UTM parameters and Event tracking.

UTM Tracking Parameters

UTM parameters are parameters that are added to links that drive traffic to your website. an example link will look like this:

http://www.example.com/cart/?utm_source=Barilliance&utm_medium=email&utm_campaign=cartReminder1

 If visitors arrive to your site after clicking the link above you will be able to track this traffic in GA using the option in the Acquisition menu (marked below).

UTM tracking is designed for tracking traffic that is coming from outside the website such as links from a 3rd party site or links in email campaigns. It shouldn’t be added to the site’s inner links. 

Barilliance rules like cart abandonment emails and email recommendations have a dedicated option for specifying tracking parameters.

If you’re not sure how to add tracking parameters Google provides a URL Builder tool

Event Tracking

Event tracking is designed to track events or actions that happen on the website.

For example if a visitor clicks Play on a video then an event could be sent to GA that will later allow you to track how many times a video was played as well as combine that event with the powerful segmentation tools GA offers.

Event data can be found under the Behavior menu:

Each event has 4 parameter the first 2 being mandatory and last 2 are optional:

Category

Action

Event Label

Value

A fifth parameter is called “non-interaction” and is meant to signify if the event is interactive ( the difference between viewing a page and clicking on a recommendation) and is used in bounce calculations by GA.

If you are using our product recommendations then Barilliance will by default send an event after each click on the onsite recommendations. We use the following naming scheme for the events:

Category: always “Barilliance”

Action: the location of the click for example: “product”/”cart”/”home

Label: the name of the product that was clicked

Triggering your own events for onsite personalization rules

If you would like to track rule exposure and interaction in GA you can trigger your own events.

Triggering events is done using Javascript and the actual syntax depends on the version of GA you are currently using.

Note: in the examples given location of commas, quote signs and semicolons are important. A missing comma or quote will, in many cases, cause the rule to stop working.

The most common version of GA in use today is Universal Analytics so we will use it in our example.

When assigning the parameters to events you are free to decide how you want to use them however there are certain guidelines you may want to follow.

ga('send', 'event', [category],[action], [label]);

[category] [action] and [label] need to be replaced with the information you to send to GA. 

Lets say you want display a banner and you want to trigger an event each time the banner is clicked. The format for sending such the event is:

ga('send', 'event', 'banner', 'click', 'Christmas Promotion');

The above line sends an event to GA with the following information:

Category: banner

Action: click

Label:Christmas Promotion

This line needs to be added to the onclick javascript part of the banner rule:

Tracking impressions using GA

To track impressions an event needs to be fired each time a rule is triggered. This is supported for Show Banner, Display Popup and, Show Offerzone actions. The tracking is done by adding a Run Javascript action to one of those actions and adding the code in the “Javascript code to run after rules” section. To add a Run Javascript action to the rule click on Select Action and then on Run Javascript. When tracking impressions it’s important to set the event as non-interactive. This is done by adding an optional parameter like this:

ga('send', 'event', ‘popup', 'impression', 'Christmas Promotion',{nonInteraction: true});

Tracking clicks inside a popup or offer zone

To track events inside a popup or offer zone (such as a click on a specific link) you need to add the event tracking code to the onlick event of the link you want to track. You will need to either edit the HTML code directly or use the editor (popup only). Given an example link that looks like this:

<a href=”http://www.example.com”>Example link</a>

it can modified to trigger an event onclick like this:

<a href=”http://www.example.com” onclick=”ga('send', 'event', 'banner', 'click', 'Christmas Promotion');”>Example link

If you can or prefer to use the editor click on the link and then on the chain icon:

Then click on the Events tab and add the code next to the onclick event.

Did this answer your question?