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).
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 probably won't see a lot of tracked web activity. Over time, 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 will last 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:
- Segment your contacts based on engagement level
By gaining insight into how 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 don't want to send someone an email every time he/she visits your website, you might want to send a light touchpoint to those who 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:
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 for Viewed Product tracking is different for each ecommerce platform:
- Guide to add Viewed Product tracking for Shopify stores here.
- Guide to add Viewed Product tracking for BigCommerce stores here.
- Guide to add Viewed Product tracking for Magento 1 stores here.
- Guide to add Viewed Product tracking for Magento 2 stores here.
- Guide to add Viewed Product tracking for WooCommerce stores here.
- Guide to add Viewed Product tracking for other platforms, or custom cart, here.
Viewed Product tracking is most often leveraged to trigger a browse abandonment flow.
Test Web Tracking
After adding the relevant code snippets to your site, you can test that tracking is set up properly by following these steps:
- Navigate to your website
- Add the following to the end of your store url, firstname.lastname@example.org with your email address:
- 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.
Over time, to see a live feed of all tracked activity for the Active on Site and Viewed Product metrics, 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.
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 its placement.