How to enable onsite tracking for Shopify

read
Last updated at:

You will learn

Learn how to enable Klaviyo onsite tracking on your Shopify store. There are two key types of Klaviyo onsite tracking: Active on Site and Viewed Product tracking. Using these events can help you engage identifiable browsers of your store. Additionally, enabling Active on Site tracking will allow you to use Klaviyo signup forms on your site. 

On April 19, 2022, Klaviyo released an app embed for the Shopify Theme Editor that enables both Active on Site and Viewed Product tracking. The app embed is the newest and easiest way to enable Klaviyo onsite tracking for Shopify. All Shopify users, including those who integrated Klaviyo with Shopify before the release, are encouraged to enable it. The app embed is available to both Shopify stores on vintage themes, and stores on Shopify 2.0 themes.

Before you begin

The two key types of onsite tracking are:

  • Active on Site
    This metric is tracked whenever an identifiable browser visits your store. It can help you segment your contacts based on engagement level.
  • Viewed Product
    This metric is tracked whenever an identifiable browser views a product page on your store. You can use it to send reminders to customers in a browse abandonment flow

Active on Site tracking is enabled by a JavaScript code snippet known as Klaviyo’s onsite Javascript, or Klaviyo.js. Viewed Product tracking is enabled by the Viewed Product code snippet, and also requires Active on Site tracking be enabled in order to function. The Klaviyo app embed automatically installs both code snippets once it’s enabled. 

Before enabling the app embed, make sure you’ve integrated Shopify with Klaviyo. No matter when you integrate, you can enable the app embed at any time. Note that the app embed for your Klaviyo account can only be associated with one Shopify store.

Shopify users who integrated with Klaviyo before April 19, 2022

Enabling Klaviyo onsite tracking and integrating with Shopify go hand in hand. If you integrated your Shopify store with Klaviyo before April 19, 2022, you would have enabled Active on Site tracking in one of the following ways:

  • If you integrated with Shopify via the Setup Wizard, the integration automatically added the Active on Site snippet to your store
  • If you integrated via the integration settings page (as described in our integration guide) and checked the recommended setting Automatically add Klaviyo onsite JavaScript, the Active on Site snippet was added to your site automatically. 
  • You may have manually added the snippet to your site by editing your theme code

If you integrated in this timeframe and enabled Viewed Product tracking, you would have done so by adding the snippet to your site manually. If you added the snippet manually, there is no need for you to enable the app embed. If you'd like to enable the app embed, make sure to remove the Viewed Product snippet that you added manually in order to help with page speed performance. 

If you integrated before April 19, 2022, but did not add the Viewed Product snippet to your site, you can now do so easily via the app embed. Once you enable the app embed in Shopify, Active on Site tracking will be automatically removed via the old method and re-added via the new method, along with Viewed Product tracking. Read on to the next section to learn how to enable the app embed in Shopify. 

Shopify users who integrated with Klaviyo after April 19, 2022

If you integrated your Shopify store with Klaviyo after April 19, 2022, you were prompted to enable Active on Site and Viewed Product tracking via the Klaviyo app embed in Shopify. If you did not follow or complete the prompt, the directions below outline how to enable the Klaviyo app embed. 

Enabling the Klaviyo app embed in Shopify

From Klaviyo

  1. From your Klaviyo dashboard, navigate to the Integrations tab. 
  2. Click Enabled Integrations and select Shopify. You’ll be brought to the integration settings page.
  3. Here, you’ll see a message calling out that your Klaviyo app embed is not yet enabled. Click the link labeled view your App Embed setting here to be brought into Shopify.
    Note that the setting to enable Viewed Product is checked by default, so Viewed Product will start tracking once you enable the app embed.Shopify onsite tracking settings in Klaviyo showing callout with yellow
    background reading The Klaviyo App Embed is not enabled
  4. If prompted to do so, sign into Shopify using the account you integrated with Klaviyo.
  5. You’ll be brought to your theme setting’s App embeds tab. Make sure the Klaviyo app embed is toggled on.
    Klaviyo Onsite Javascript app embed in Shopify toggled on
  6. Click Save
  7. Navigate back to your Shopify integration settings page in Klaviyo, and refresh the page if needed. You should see a green callout noting that your app embed is now enabled.
    Shopify onsite tracking settings in Klaviyo showing callout with green background reading The Klaviyo App Embed is enabled on your Shopify store, and Viewed Product checked

From Shopify

  1. From your Shopify admin, under Sales Channels click Online Store to open the dropdown.
  2. Select Themes
  3. Find your current theme and click Customize
  4. In the left hand menu, select Theme settings
  5. Click the App embeds tab and search forKlaviyo.”
    Shopify store app embeds tab under Theme Settings with Klaviyo in the
    searchbar
  6. The Klaviyo app embed will appear in the list, because you already installed the Klaviyo app while integrating. Make sure the app embed is toggled on.
    Klaviyo Onsite Javascript app embed in Shopify toggled on
  7. Click Save
  8. To check that your app embed was toggled on correctly, navigate to the Integrations tab in Klaviyo. 
  9. Click Enabled Integrations and select Shopify. You’ll be brought to the integration settings page.
  10. Here, you should see a message calling out that your Shopify app embed is enabled, and the Viewed Product setting is checked by default.
    Shopify onsite tracking settings in Klaviyo showing callout with green
    background reading The Klaviyo App Embed is enabled on your Shopify store,
    and Viewed Product checked

Outcome

You have now enabled Klaviyo onsite tracking for your Shopify store. 

Additional resources

x
Was this article helpful?
145 out of 214 found this helpful