Skip to main content
Click tracking

Track your customers' engagement on your site through clicks.

Updated over 7 months ago

Many companies use tracking codes in their click-through URLs, commonly to work with Google Analytics. When shoppers click through from any messages with tracking codes in the links, Fresh Relevance also recognizes the codes, and stores all their actions against those campaign codes.


View purchases

You can then see the purchases and other actions which were as a result of each of your campaigns. This includes both bulk campaigns and triggered messages. To see the reports:

  1. Go to Reports > All Reports > Detailed Performance Data > Campaigns.

The last-click tracking code used by the standard cart layouts should be familiar to users of Google Analytics, and looks like this:

<a href='http://mysite.com/clothing/trousers.html?utm_campaign=tms-cart-1&utm_medium=email&utm_source=tms'>

Change the Last Click (Google Analytics) tracking codes

Fresh Relevance can use exactly the same codes, so you don't need to do anything apart from use a standard cart layout. However, if you need to make changes, here's an explanation of how it works.

The script which makes this appear is:

{% set ga_campaign_code='tms-cart-1' %}


<a href='{{ product.u | set_ga_tracking( utm_campaign=ga_campaign_code , utm_medium='email' , utm_source='tms' ) }}'
style='text-decoration: none; color: #444;'>

In some situations, you may want to use different analytics codes for the messages which are sent out by later steps in your series of abandonment messages. You can do this by changing that script to this at the top of the cart layout, replacing ga_for_n_email with the last-click tracking code that you want to use for each step in the series:

 {% if trigger.active_action_index < 2 %}
{% set ga_campaign_code='ga_for_first_email' %}
{% elif trigger.active_action_index < 4 %}
{% set ga_campaign_code='ga_for_second_email' %}
{% else %}
{% set ga_campaign_code='ga_for_third_email' %}
{% endif %}

You can then change the links to use this variable:

<a href={{ product.u  | set_ga_tracking( utm_campaign=ga_campaign_code , utm_medium='email' , utm_source='tms' ) }}>

There's a lot more you can do with Fresh Relevance to capture web analytics data.

Learn more in the Web analytics section of Integration API.


Dealing with websites which need a specific order of query collection parameters

set_ga_tracking works for most links, but re-orders existing query collection parameters. If your website requires the existing parameters to appear first, you can append the tracking parameters:

{{ product.u }}{{ get_ga_tracking( utm_campaign=ga_campaign_code, utm_medium='email', utm_source='fr' ) }}

This function get_ga_tracking only returns the new Google Analytics tracking codes to be added. For example, the above call to get_ga_tracking return something like this:

utm_campaign=fr-cart-1&tmcv=1&tmcs=mdpn6d0&tmty=b&utm_source=fr&utm_medium=email&tmti=1

Did this answer your question?