Klaviyo Web Tracking


Klaviyo supports two key types of web tracking:

  • Active on Site: This metric is tracked whenever an identifiable browser visits your website
  • Viewed Product: This metric is tracked whenever an identifiable browser views a product page on your website (for ecommerce stores)

In order to send targeted and personalized emails that resonate with your customers, subscribers, or general stakeholders, you have to understand who these individuals are - their behavior, why and how they engage with you. By enabling basic web tracking on your website, you can start to collect helpful information around browsing activity that can be leveraged to take both your email marketing and your business analytics to the next level.


To enable web tracking, all you have to do is copy short snippets of code to your site.

Who Klaviyo Tracks

When you add Klaviyo's web tracking snippet(s) to your site, we are only able to track the browsing activity of "known browsers" - i.e. browsers that have visited and engaged at least once before. Klaviyo will not track anonymous browsers. 

There are three key ways Klaviyo will be able to identify a site visitor for web tracking purposes:

  • If someone has, at some point, clicked through a Klaviyo email to your website
  • If someone has, at some point, subscribed/opted-in through a Klaviyo form
  • If someone has, at some point, logged into your site and you have identify tracking installed

For this reason, until you start sending emails with Klaviyo and start growing your lists, you likely will not see much tracked web activity. Overtime, however, Klaviyo will be able to identify more and more of your contact-base and your web tracking data will become more comprehensive.

Once a user is identified, the web cookie has the lifespan of 2 years.

Active on Site Tracking

Klaviyo's standard website tracking takes the form of an Active on Site metric. When web tracking is installed, this metric gets tracked whenever an identifiable browser visits your website. Ways you can leverage this metric:

  • Segmenting your contacts based on engagement level to inform marketing strategy. Turning newsletter subscribers into first-time customers, or first-time customers into repeat customers, can be challenging. By gaining insight into how these contacts are interacting with your website - how often, what pages they view - you can build a more personal communication strategy that drives deeper engagement.
  • Trigger an automated email to those that browse several times without purchasing. While you likely won't want to send someone an email every time he/she visits your website, you might want to send a light touchpoint to those that visit several times in a short period of time but don't engage further. For example, you can trigger a flow to those who have been Active on Site at least 4 times in the last 30 days, but haven't started or completed a checkout.

To start tracking this metric, copy the following code snippet to your site's main template:

<script type="text/javascript">
  var _learnq = _learnq || [];

  _learnq.push(['account', 'API_KEY']);

  (function () {
  var b = document.createElement('script'); b.type = 'text/javascript'; b.async = true;
  b.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'a.klaviyo.com/media/js/analytics/analytics.js';
  var a = document.getElementsByTagName('script')[0]; a.parentNode.insertBefore(b, a);

Where you see API_KEY, you will need to replace this with your Klaviyo account's public API Key. To find your public API Key, navigate to Account > Settings > API Keys.

Viewed Product Tracking

Viewed Product tracking in Klaviyo is specifically designed for ecommerce stores. When product page tracking is installed, a Viewed Product metric will get tracked whenever an identifiable browser views a product page on your website.

The code snippet to install for Viewed Product tracking is different for each ecommerce platform:

Viewed Product tracking is most often leveraged to trigger a Browse Abandonment automated email flow. Learn more about the Browse Abandonment flow.

Test Web Tracking

After configuring the relevant code snippets on your site, you can test that tracking is set up properly by following these steps:

  1. Navigate to your website
  2. Add ?utm_email=email@example.com to the end the URL, replacing email@example.com with your email address
  3. After your reload the page, search in Klaviyo for your email address
You should see that a Klaviyo profile has been created for you (if one didn't exist already) and that this site visit has been tracked on your activity feed.

Overtime, to see a live feed of all tracked activity for the Active on Site or Viewed Product metric, you can navigate to the Activity Feed tab of your Dashboard. Here, you can filter for the metric of your choice:


You can also navigate to the Metrics tab of your account and click on each metric to analyze tracked data through charts, graphs, and cohort reports.

The _ke Parameter

When you have Email to Website Tracking enabled, and have Klaviyo's main web tracking snippet on your website, Klaviyo will be able to identify individuals that click through a Klaviyo email and then end up browsing your website. This is one of the main ways Klaviyo is able to identify new site visitors and cookie them so they get identified during all future visits to your page.

The way Klaviyo's Email to Website Tracking works, we add an additional parameter to all URLs in your email. This is the _ke parameter. The unique encoded value here is then decoded by our web tracking snippet and allows us to identify the user that clicked through the URL.

This parameter is automatically appended and will not impact the load times of your links nor break any links based on it's placement.


Was this article helpful?
0 out of 1 found this helpful