---
title: "How to migrate to our automatic Added to Cart event for Shopify"
description: "Learn how to migrate from Klaviyo’s existing Added to Cart event for Shopify (enabled via a code snippet) to the automatically tracked Added to Cart event, which syncs via a Shopify Server Pixel. When migrating, you can also enable new tracking events for identified users such as Viewed Collection and Submitted Search."
canonical_url: "https://help.klaviyo.com/hc/en-us/articles/28709780787355"
markdown_url: "https://help.klaviyo.com/hc/en-us/articles/28709780787355.md"
locale: "en-us"
category: "Integrations"
section: "Shopify best practices"
updated: "2026-10-26"
---

# How to migrate to our automatic Added to Cart event for Shopify

**📝 Note:** Are you new to Klaviyo? You can track Shopify *Added to Cart* events in Klaviyo automatically by [enabling onsite tracking](https://help.klaviyo.com/hc/en-us/articles/4425956184731.md).

Learn how to migrate from Klaviyo’s existing *Added to Cart* event for Shopify (enabled via a code snippet) to the automatically tracked *Added to Cart* event, which syncs through Shopify pixels. When migrating, you can also enable new tracking events for identified users such as *Viewed Collection* and *Submitted Search*.

These new Shopify Pixel events are branded with a Shopify icon in Klaviyo, while events enabled by a Klaviyo snippet have a gear icon.

## Before you begin

*Added to Cart* event data synced through automatic Shopify tracking cannot be customized. To learn what data is included with the new event, consult our [Shopify data reference](https://help.klaviyo.com/hc/en-us/articles/115005080447.md#h_01J6F8FWMEH250MPETV9FSDWF3).

**📝 Note:** Based on your Customer Privacy settings in Shopify, Klaviyo may not track onsite events for visitors to your Shopify store in the EU, EEA, UK and Switzerland, unless they have provided consent.

## Why migrate?

There are many reasons to migrate, including:

- The Shopify-branded event can identify visitors through Shopify, including visitors who were not cookied by the old Klaviyo snippet.

- The new event includes more top-level metadata than the snippet event, including variant info, SKUs, item quantity, and links to the variant added to the cart. 

- The new event will be actively maintained by Klaviyo going forward, with future enhancements added directly. 

- Enabling the new event does not require a code snippet.



We recommend migrating in the following order (as detailed in this article):

1. Enable our new *Added to Cart* tracking.

2. Update segments, flows, and more in Klaviyo.

3. Remove your old *Added to Cart* snippet.



Please note that we are not currently deprecating our *Added to Cart* snippet.

## Enable new Added to Cart tracking

1. In Klaviyo, select the **Integrations** tab.

2. Select **Shopify** from the list to be brought to the integration settings page.

3. Under **Additional tracking features** in the **Onsite Tracking** section, select **Track behavioral events**. If you see **Get started** instead, click it and select **Behavioral events**.



![Image](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/70c464b26b5cafa6bf669b1c5b457c238df9d1c4-1152x230.png?auto=format)

4. If you selected the checkbox on the settings page, click **Update Settings**. If you used **Get started**, click **Save**, or click **Next**, review your profile sync settings, and then click **Save**.

5. If prompted: Log in to Shopify.

6. If prompted: Review the permissions and click **Update app**.




![Image](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/0b6c5889dafb0cf18e3b9b8289ba1c6536335433-1456x1152.png?auto=format)

7. Back in Klaviyo, select **Update Integration** in the confirmation modal.



![Image](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/dc5a3930270c832b5efc2120138f44fb2207c2eb-1896x690.png?auto=format)

8. Confirm that the success message appears.



![Image](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/ed804e72794dfb181868d426ab22b7c5ae313d3c-1852x1000.png?auto=format)

Before updating segments and flows, [test your tracking](#h_01J9236790CK2WW8WMZFD8QS17) and confirm that a Shopify-branded *Added to Cart* event appears in your account.

## Update segments, flows, and more in Klaviyo

Update references to the gear-icon *Added to Cart* metric using the guidance below. Keep the old metric in segment conditions where you need to include historical activity.

### Segments

1. Navigate to **Audience > Lists & segments** and look for segments where you’ve used the unbranded *Added to Cart* metric.

2. For a condition such as *Added to Cart* at least once in the last 30 days, keep the original condition and add an **OR** condition using the Shopify-branded *Added to Cart* metric, as shown below. For a zero-times condition, require zero occurrences of both metrics with **AND**.



![Image](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/61ea297961e6d374266dfbdd8c4735c6d7cd1ef6-2168x762.png?auto=format)

3. Click **Update segment** to save each segment.



### Flows

For flows triggered by the gear-icon *Added to Cart* metric, follow the cloning steps below. If a flow uses the old metric only in filters or splits, update those conditions without changing its trigger.

1. In **Flows**, find a flow triggered by the gear-icon *Added to Cart* metric.

2. [Clone the flow](https://help.klaviyo.com/hc/en-us/articles/24898429283739.md): open its 3-dot menu and select **Clone**. Choose **Clone to this account**, enter a descriptive name, and click **Continue**.

3. In the **Trigger** dropdown, select the Shopify-branded *Added to Cart* metric. Click **Clone flow**, then open the new flow.

4. Review the cloned flow’s trigger filters, profile filters, and splits for references to the old metric or event properties. Update them as needed, and check the event variables in each message against a sample Shopify *Added to Cart* event.

5. Send a test email for each new flow to make sure that everything looks good and that no variables need to be updated. If you were using our default snippet, all existing variables should be the same, except that the price is now a numeric value instead of a string (e.g., 4 vs. $4.00). You can add currency formatting like this:
`{% currency_format event|lookup:'Price'|floatformat:2 %}`
Additionally, please note that the new *Added to Cart* event does not currently include other items already in the cart; it just tracks a single item.

6. In the old flow, click **Update status**, set **Flow status** to **Draft**, choose **Update status now**, and click **Save**.

7. In the new flow, click **Review and turn on**, set **Flow status** to **Live**, choose **Update status now**, and click **Save**.



### Analytics

If you’re using the unbranded *Added to Cart* metric in any analytics, such as custom reports, you should [build new custom reports](https://help.klaviyo.com/hc/en-us/articles/360047725651.md). If you're using the unbranded *Added to Cart* metric in metric mapping, you should [update the mapping](https://help.klaviyo.com/hc/en-us/articles/25829057055899.md).

## Remove your Added to Cart snippet

Before removing your snippet, check any product feeds that use **Products a customer has added to cart**. Feeds that still use the old metric need to be updated to use the Shopify metric.

![Image](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/1d627b7ece36c62162fd0fdc237842440cafb1ce-1068x810.png?auto=format)

For each feed that uses the old metric:

1. Open the **Product feeds** list and click the feed’s name.

2. Under **What products should the customers view first?**, select **Products a customer has added to cart (Shopify)**. The Shopify label appears when more than 1 Added to Cart source is available.

3. Review the fallback product selection and click **Save Product Feed**. Once your feeds use the Shopify metric, continue with snippet removal.



You may have added your snippet in one of 2 ways:

- If you added the snippet in a custom Liquid block, remove it from that block.

- If you added the snippet directly to a theme file, remove it from that file.



To remove your snippet:

1. In Shopify, navigate to **Online Store > Themes**.

2. Find your theme and click **Customize**.

3. If you added the snippet in a custom Liquid block:

   1. At the top of the page, click the Home page dropdown.

   2. Select **Products > Default product** to be brought to your default product page.

   3. Find the custom liquid block you used for your *Added to Cart* snippet. There are multiple code snippets you may have used; look for the line `_learnq.push(['track', 'Added to Cart', cart]);` if you aren’t sure.

   4. When you have the block selected, click **Remove section**.




![Image](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/c46d81e8052eb6c9c4f2b97f3fac90f274e4d855-658x1196.png?auto=format)

  1. Click **Save**.

4. If you added the snippet directly to a theme file:

   1. Click the 3 dots at the top and select **Edit code**.

   2. Open the theme file where you added the snippet, such as `theme.liquid`.

   3. Find your *Added to Cart* snippet code. 

   4. There are multiple code snippets you may have used; look for the line `_learnq.push(['track', 'Added to Cart', cart]);` if you aren’t sure.

   5. Delete the snippet, starting with the opening <script> tag and ending with the closing </script> tag.




![Image](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/b903aba4c3ca3796e1084d11f9918d160c9602a8-1618x940.png?auto=format)

  1. Click **Save**.



You have now removed your *Added to Cart* snippet.

## Troubleshooting

Are you not seeing new *Added to Cart* events appear in your account?

For server-side tracking, a profile previously cookied by Klaviyo may still need to be identified by Shopify.

For Shopify’s server-side tracking of *Added to Cart*, *Viewed Collection*, and *Submitted Search*, profiles will be identified if they do one of the following:

- Submit a Klaviyo form.

  - You must have enabled syncing profiles from Klaviyo to Shopify for this to work.

- Submit a Shopify form.

- Enter their information on the checkout page.

- Log in to their Shop account on the checkout page.

- Log in to their customer account on the store.



Complete one of the items above, then add an item to your cart to test your *Added to Cart* tracking. Open your test profile in Klaviyo and confirm that an *Added to Cart* event with the Shopify icon appears in its activity.

If the event does not appear, confirm that **Track behavioral events** is selected in your Shopify integration settings and that your test visitor has provided any consent required by your Shopify Customer Privacy settings.

## Outcome

You’ve now migrated from Klaviyo’s manually-enabled *Added to Cart* tracking to our automatic *Added to Cart* tracking in Shopify.

## Additional resources

- [How to enable onsite tracking for Shopify](https://help.klaviyo.com/hc/en-us/articles/4425956184731.md)
  Learn how to enable Klaviyo onsite tracking on your Shopify store, which includes multiple events to help you engage identifiable browsers. Additionally, enabling onsite tracking allows you to use Klaviyo sign-up forms on your site. 

- [Shopify data reference](https://help.klaviyo.com/hc/en-us/articles/115005080447.md)
  Learn what data syncs from Shopify to Klaviyo and where to view it. This includes both order data (such as Placed Order, Ordered Product, etc.), delivery data, onsite tracking data, and customer data. If you have not already, read our guide on getting started with Shopify for step-by-step instructions on integrating, before continuing with this article.
