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

Estimated 6 minute read

|

Updated Aug 27, 2025, 12:00 AM EST

Table of contents

Are you new to Klaviyo? You can track Shopify Added to Cart events in Klaviyo automatically by enabling onsite tracking.

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.

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.

How to migrate to our automatic Added to Cart event for Shopify - 图1

How to migrate to our automatic Added to Cart event for Shopify - 图2

  1. 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.
  2. If prompted: Log in to Shopify.
  3. If prompted: Review the permissions and click Update app.

How to migrate to our automatic Added to Cart event for Shopify - 图3

How to migrate to our automatic Added to Cart event for Shopify - 图4

  1. Back in Klaviyo, select Update Integration in the confirmation modal.

How to migrate to our automatic Added to Cart event for Shopify - 图5

How to migrate to our automatic Added to Cart event for Shopify - 图6

  1. Confirm that the success message appears.

How to migrate to our automatic Added to Cart event for Shopify - 图7

How to migrate to our automatic Added to Cart event for Shopify - 图8

Before updating segments and flows, test your tracking 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.

How to migrate to our automatic Added to Cart event for Shopify - 图9

How to migrate to our automatic Added to Cart event for Shopify - 图10

  1. 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: 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. If you're using the unbranded Added to Cart metric in metric mapping, you should update the mapping.

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.

How to migrate to our automatic Added to Cart event for Shopify - 图11

How to migrate to our automatic Added to Cart event for Shopify - 图12

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:
  4. At the top of the page, click the Home page dropdown.
  5. Select Products > Default product to be brought to your default product page.
  6. 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.
  7. When you have the block selected, click Remove section.

How to migrate to our automatic Added to Cart event for Shopify - 图13

How to migrate to our automatic Added to Cart event for Shopify - 图14

  1. Click Save.

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

  3. Click the 3 dots at the top and select Edit code.
  4. Open the theme file where you added the snippet, such as theme.liquid.
  5. Find your Added to Cart snippet code.
  6. 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.
  7. Delete the snippet, starting with the opening <script> tag and ending with the closing </script> tag.

How to migrate to our automatic Added to Cart event for Shopify - 图15

How to migrate to our automatic Added to Cart event for Shopify - 图16

  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

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.

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.

Was this article helpful?

YesNo

Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community

Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.

Visit Community

Partners

Hire a Klaviyo-certified expert to help you with a specific task, or for ongoing marketing management.

Hire a partner

Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance Availability varies by location and plan type

Log in