You will learn
Learn about anonymous visitor activity backfilling and how to capture shoppers’ onsite engagements before they are identified.
Before you beginBefore you begin
By default, Klaviyo’s web tracking supports:
-
Active on Site tracking
This metric is tracked whenever an identifiable browser visits your website.
-
Viewed Product tracking
This metric is tracked whenever an identifiable browser views a product page on your website (for ecommerce stores).
Active on Site can help segment your contacts based on engagement level, while Viewed Product tracking can enable you to send customers reminders in a browse abandonment flow.
Note that some integrations do not have Viewed product tracking installed automatically.
Klaviyo’s standard web tracking
In order for Klaviyo to track a shopper’s onsite activity by default, they must be identified. This is done through Klaviyo’s JavaScript, which sets a cookie that allows for the tracking and identification of site visitors through an auto-generated ID when they:
- Fill out a Klaviyo signup form
- Click a link from a Klaviyo email
This cookie can temporarily hold personally identifiable information and lasts for two years.
The Klaviyo cookie is only used for web tracking after a shopper has been identified and does not store data for anonymous visitors.
Anonymous visitor activity backfill
With Klaviyo’s anonymous visitor activity backfill, you can capture onsite activity for a shopper prior to identification. Once that visitor is identified in the future, you’ll then have access to their historical onsite events. This allows you to have a more complete view of your customers’ journeys, regardless of when they are identified through Klaviyo’s web tracking.
The anonymous activity backfill only captures and sets historical events on a profile. Other historical information like Source will not be captured by this feature.
How Klaviyo collects onsite data for anonymous visitors
To collect onsite data for anonymous visitors, Klaviyo records data about a visitors actions as they occur and stores that locally in their browser. In the future when that visitor is identified, that data is then sent to Klaviyo and cleared from the browser. Any future onsite activity will be tracked as usual through the Klaviyo cookie once they have been identified as well.
To store data in the browser, the shopper’s browser must support setting items in local storage or indexedDB.
See a list of browsers that support writing data into local storage and support storing data in indexedDB.
Enabling anonymous visitor activity backfill
To collect anonymous visitor activity, you must have the Klaviyo.js installed on your store. Klaviyo.js allows you to publish Klaviyo sign-up forms and track shoppers’ activities on your website. The Klaviyo.js is installed automatically with a number of integrations, but can also be added to your website manually.
Once the Klaviyo.js is successfully installed on your website, you can enable anonymous visitor activity backfill in your account settings.
To enable anonymous visitor activity backfill:
- Navigate to Account > Settings in the bottom left corner in Klaviyo.
- On the Data tab in your account settings, check the Enable anonymous visitor tracking box.
Testing anonymous activity capture
To verify that anonymous visitor historical backfill is working, you can take the following steps:
Make sure that front-end events, such as Viewed Product, are triggering successfully prior to testing.
- Navigate to your website in a private window and take an onsite action like Viewed Product.
-
Open the developer console on your browser and navigate to local storage or indexedDB. This may be on the developer console’s Storage or Application tab depending on your browser.
- Verify that the key and values set in the browser match the actions you took while anonymous. Note the timestamp of the data.
- After confirming that data is being stored in the browser, add ?utm_email=example@gmail.com to the end of your website URL, replacing example@gmail.com with a test email address and reload the page. This will identify the browser based on the email address you provide.
- Search for the email address in Klaviyo.
You should see a profile matching the email address that you supplied, with an activity timeline corresponding to the actions you took while anonymous. Ensure that the key and values in your local storage have been cleared out, and that the events have made their way into your Klaviyo account with the correct timestamps.
Frequently asked questionsFrequently asked questions
Is this feature enabled by default?Is this feature enabled by default?
No, anonymous visitor activity backfill is not enabled by default. The feature must be toggled on in your account settings.
What events are included in post-identification syncing?What events are included in post-identification syncing?
Only client-side events, also known as front-end events, are captured through Klaviyo’s web tracking for both identified and anonymous visitors. These events are captured through Klaviyo's main onsite tracking snippet, known as Klaviyo.js.
Some common events include:
- Active on site
- Viewed product
- Added to cart (if installed)
However, any events recorded onsite via klaviyo.track() are also included in anonymous activity backfill.
Note that some integrations may use server-side events for these. For example, the Added to Cart event on Magento 2 is sent server-side.
If you are not seeing these events being backfilled, check if the event is sent client-side through Klaviyo.js or server-side as part of the integration.
How many events can be stored in local storage?
There is a 5MB limit imposed by a browser’s local storage, allowing for up to 10,000 events.
Why use local storage for data storage over cookies?Why use local storage for data storage over cookies?
Cookies are less robust compared to local storage. For example, cookies have an expiration date and a maximum size of about 4KB. Local storage can hold 5 MB on average (depending on the browser).
Safari has a 7 day expiration policy for local storage.
Are there any GDPR or privacy concerns?
Anonymous visitor activity backfill uses a browser's local storage to store data sent as a profile property or event until the browser is identified (after which the local data is cleared).
Until it is cleared, data in local storage is accessible to any on-website Javascript. This can pose a privacy concern if you send certain types of sensitive data through front-end events. For sensitive data, Klaviyo recommends only sending the data via server-side requests, or only after a browser is identified.
Does anonymous visitor activity backfill work with a cookie consent tool?Does anonymous visitor activity backfill work with a cookie consent tool?
If your store uses a cookie consent tool (e.g., OneTrust), the shopper would need to opt-in for anonymous activity to be captured. Without access, Klaviyo will not be able to write data to the browser’s local storage.
Do anonymous visitors trigger flows?Do anonymous visitors trigger flows?
Once an anonymous visitor is identified through Klaviyo's standard web tracking, they will trigger flows as long as they qualify and have not exceeded time delays.
Additional resources