Getting started with Shift4Shop

Estimated 7 minute read
|
Updated Nov 27, 2024, 3:59 PM EST
You will learn

You will learn

Learn how to integrate Shift4Shop (formerly 3dcart) with Klaviyo in order to personalize and target emails based on each customer's purchases and website activity. The data synced from Shift4Shop to Klaviyo includes:

  • Data about orders your customers make, including sales, refunds, fulfilled orders, and cancelled orders
  • Detailed customer information, including when and how often people visit your website

Klaviyo only syncs information for customers who have placed an order within the last three years.

Table of contents

Table of contents

  1. Add the Shift4Shop Integration
  2. Add Klaviyo onsite tracking
  3. Monitor the data sync
  4. Data synced from Shift4Shop
  5. Additional resources
Add the Shift4Shop integration

Add the Shift4Shop integration

  1. In Klaviyo, click your account name in the lower left corner and then select Integrations > Add integrations.
  2. Search for Shift4Shop and click the card, then click Install.
  3. To find your Shift4Shop store URL (also known as your secure URL), open your Shift4Shop account in a new tab.
  4. In Shift4Shop, go to Settings > General > Store Settings.
  5. Under Store Information, click on Manage Domain & Store URL.
    Shift4Shop settings page showing store information
  6. Copy the Store URL from beneath Domain Settings.
    Shift4Shop domain settings showing store URL
  7. Back in Klaviyo, paste your Store URL in the box and click Connect to Shift4Shop.
  8. Copy the Klaviyo Public API Key that appears on the next page.
  9. Click the Go to Shift4Shop button.
  10. On the REST API Apps page in Shift4Shop, click Add in the top right hand corner to add the Klaviyo API key.
    REST API Apps page in Shift4Shop with Add button with blue background
  11. Paste the Klaviyo public API key (2bd83b00fcd7d56916a28c452d3d080c).
    Public key setting in Shift4Shop with Save button with blue background
  12. Click Save.
  13. A popup window will appear, asking you to give Klaviyo authorization to pull the Shift4Shop data into our platform; click Authorize.
    Klaviyo settings in Shift4Shop showing required permissions with Authorize button with blue background
  14. You will be redirected back to your Klaviyo account and your data will begin to sync. A success callout will confirm that your data is syncing.
Add Klaviyo onsite tracking

Add Klaviyo onsite tracking

There are two Klaviyo onsite tracking code snippets you can add to your Shift4Shop site. The first onsite tracking snippet allows you to track when cookied users are active on your site (the Active on Site metric) and the second onsite tracking snippet allows you to track what products they view (the Viewed Product metric).

You can then use the Active on Site metric to create segments of known browsers who have visited your site but haven't purchased anything. The Active on Site snippet (also known as Klaviyo.js) also enables the use of Klaviyo sign-up forms. 

Viewed Product tracking is most often leveraged to trigger a Browse Abandonment automated email flow. For more information, see our article on creating a browse abandonment flow.

  1. Log in to your Shift4Shop store admin and navigate to Content > Site Content.
  2. Click on the Edit button under Header & Footer.
    Site Content page in Shift4Shop with Edit with blue background under Header and Footer
  3. Click the + to the right of Global Header to open the header editor.
  4. Click the slider next to WYSIWYG Mode Off / On to toggle the view to the HTML editor.
  5. To add Active on Site tracking, paste the following script at the bottom of the HTML editor:
    <script type="text/javascript" async="" src="https://static.klaviyo.com/onsite/js/PUBLIC_API_KEY/klaviyo.js"></script>
    <script type="text/javascript"> 
    //Initialize Klaviyo object on page load
    !function(){if(!window.klaviyo){window._klOnsite=window._klOnsite||[];try{window.klaviyo=new Proxy({},{get:function(n,i){return"push"===i?function(){var n;(n=window._klOnsite).push.apply(n,arguments)}:function(){for(var n=arguments.length,o=new Array(n),w=0;w<n;w++)o[w]=arguments[w];var t="function"==typeof o[o.length-1]?o.pop():void 0,e=new Promise((function(n){window._klOnsite.push([i].concat(o,[function(i){t&&t(i),n(i)}]))}));return e}}})}catch(n){window.klaviyo=window.klaviyo||[],window.klaviyo.push=function(){var n;(n=window._klOnsite).push.apply(n,arguments)}}}}(); </script>
  6. In the first line of the snippet, replace Public API Key with your Klaviyo Public API Key, found under Account name > Settings > API Keys in Klaviyo.
  7. To add Viewed Product tracking, add this script underneath the Active on Site script in the header:
    <script type="text/javascript">
    var klaviyo = window.klaviyo || [];
    
    // Track each product view.
    if ('[price]' !== '[' + 'price]') {
       klaviyo.track("Viewed Product", {
          ProductID: "[id]",
          Name: "[name]",
          Description: "[description]",
          URL: [location.protocol, '//', location.host, location.pathname].join(''),
          Categories: "[catid]",
          ImageURL: [location.protocol, '//', location.host, '/[image1]'].join(''),
          Price: parseFloat("[price]".slice(1), 10)
       });
    }
    </script>

     8. In the top right hand corner of the page, click Save

Monitor the Klaviyo sync

Monitor the Klaviyo sync

To view your Shift4Shop integration data:

  1. In your Klaviyo account, navigate to Analytics > Metrics.

  2. Click on the Placed Order metric to verify that your data has started to populate. If you see data populating the chart, that means the Shift4Shop integration is successfully syncing to your account. When the sync is complete, you’ll see a green border next to the Shift4Shop integration when viewed in the Integrations tab (found under Account name > Integrations).
    Shift4Shop integration card in Klaviyo with green bar on the left

  3. Klaviyo imports all of your historic Shift4Shop data. To verify this, compare the number of orders on a particular day in Klaviyo with what's in your Shift4Shop interface and confirm they match. 

  4. If they don't match, the issue is most likely that your Klaviyo account's timezone doesn't match your Shift4Shop timezone. To check your timezone setting in Klaviyo, go to Account name > Settings > Organization

  5. In the middle of this page, you will see an area to set your timezone. Update your Klaviyo account to the correct timezone and click Update Information.

Data synced from Shift4Shop 

Data synced from Shift4Shop 

The Shift4Shop integration syncs data into Klaviyo once every hour, so you should see events appear in Klaviyo within an hour of when the event is recorded in Shift4Shop.

The following metrics are synced from Shift4Shop:

  • Fulfilled Order
  • Ordered Product
  • Placed Order
  • Started Checkout

Klaviyo metrics tab filtered by Shift4Shop showing metrics such as Fulfilled Order and Ordered Product

Fulfilled Order

Fulfilled Order

This event is tracked when a customer completes the checkout process and creates an order in your Shift4Shop store. It includes all the product information about the items someone purchased including product names, images, and variation information to use in purchase follow-up emails. You can filter and target Fulfilled Order events based on the following criteria:

  • Items: the names of the products in someone's order, e.g., t-shirt or pants
  • Categories: the complete set of the categories of the products in someone's order, e.g., t-shirts, men's, pants, and sale
Ordered Product

Ordered Product

This metric is tracked when a customer places their order, and tracks an event for each item someone purchases. For example, if someone buys a t-shirt and a pair of pants, two Ordered Product events are created - one for the t-shirt and one for the pants.

The Ordered Product event includes detailed information about each product someone purchases. This is useful when creating behavioral segments based on product variation options and other detailed information that's not available in the Placed Order event. You can filter and target Ordered Product events based on the following criteria:

  • Name: the name or title of the product in Shift4Shop, e.g., t-shirt or pants
  • SKU: the SKU of the product variation e.g., REDMEDIUMTSHIRT
  • Categories: the complete set of the categories of the product, e.g., t-shirts, men's, and sale
Placed Order

Placed Order

This event is tracked when a customer completes the checkout process and creates an order in your Shift4Shop store. It includes all of the product information about the items someone purchased including product names, images, and variation information to use in purchase follow-up emails. You can filter and target Placed Order events based on the following criteria:

  • Items: the names of the products in someone's order, e.g., t-shirt or pants
  • Categories: the complete set of the categories of the products in someone's order, e.g., t-shirts, men's, pants, and sale
  • Item Count: the number of items in the order, e.g., 2

Note: By default, Shift4Shop syncs two statuses for Placed Order: 2, 4

Started Checkout

Started Checkout

This event is tracked when a customer enters their contact and shipping information on the page before the payment page in the Shift4Shop checkout process and clicks continue. It includes all of the product information about the items in someone's cart, including product names, images, and variation information to use in your abandoned cart emails. You can filter and target Started Checkout events based on the following criteria:

  • Items: the names of the products in someone's cart, e.g., t-shirt or pants
  • Categories: the complete set of the categories of the products in someone's cart, e.g., t-shirts, men's, pants, and sale
Customer Data

Customer Data

In addition to the metrics Klaviyo syncs from Shift4Shop, there are also properties that are added to each Klaviyo profile. You can use these properties in segments and in flows. The following built-in Klaviyo properties automatically synced from Shift4Shop:

  • Email
  • First Name
  • Last Name
  • City
  • State/Region
  • Zip Code
  • Country
  • Phone Number
Outcome

Outcome

You’ve now integrated with Shift4Shop, enabled Klaviyo onsite tracking, and verified your synced Shift4Shop data. Now, you can view your Shift4Shop data in Klaviyo and personalize and target emails based on each customer's purchases and website activity. 

Additional resources

Additional resources

Was this article helpful?
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.
Live training
Join a live session with Klaviyo experts to learn about best practices, how to set up key features, and more.
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