Shopify App

Overview

Amplitude’s app with Shopify is a smart analytics app that automates eCommerce tracking. With Amplitude’s app, you can automatically track and ingest key e-commerce events, event properties, and user properties on a Shopify or Shopify Plus store.

Key Consideration

  • Our Shopify App was built to solve the general use cases for most Shopify stores. We designed a generalized Out of the Box Taxonomy to include events and properties that most Shopify stores would be interested in tracking.

  • We recommend leveraging our Amplitude SDKs or APIs in addition to this app if your Shopify Store has a high degree of in-built functionality or if you require instrumenting a lot of custom events outside our taxonomy list.

  • In addition, using Govern, you’ll be able to manage event types, properties, and user properties from a single interface.

Getting Started

Installation requirements

  • Have an existing online Shopify or Shopify Plus store
  • Sign up OR have an existing Amplitude Starter, Growth, or Enterprise plan

Installation Steps

  1. Login to your Shopify Store account.
  2. Go to the Shopify app store listing and search for "Amplitude" or use this direct link here.
  3. Click Add app to begin the installation process
  1. Sign up for an Amplitude account or login to your existing Amplitude organization.
  2. Once you are inside your Amplitude project, Navigate to Sources and DestinationsDestinations.
  3. Under Add More Destinations …, click the Shopify panel.
  1. Once you’ve clicked on the Shopify tile, copy the Amplitude project’s API key from your respective project.
  1. Paste the “Amplitude API Key” field in the Shopify Admin portal and click the Connect Button. The app will show Connected if the app has been installed successfully and created a valid connection between your Shopify store and Amplitude.
  1. Choose a User_ID for known customers. To support a broader range of use cases, our app lets you choose which of the following fields you want to send as the User_Id for known customers.
  • Email (default) – Recommended when other platforms use the email and can’t hash it, and you are comfortable with the privacy implications.

  • Hashed email – The MD5 email hash is useful if you have other marketing platforms sending traffic where you know the email of the visitor (e.g. email marketing like Bronto or Marketo), but not their Shopify customer ID.

  1. The last step involves confirming that Amplitude’s code snippet is installed which will allow Amplitude's SDK to automatically track key events and events properties. To do this, you’ll need to go into Themes > Current Theme > Actions > “Edit Code.”
  1. Check if the following code snippet is installed. It should be located before the theme’s closing tag in the theme.liquid file. If not, please paste in the following code snippet before the theme's closing tag theme.liquid file. Once that’s done, the installation process is now complete.
<!-- Amplitude -->
{% render 'amplitude' %}

SDK Configurations

Amplitude's JS SDK powers the out-of-the-box integration with Shopify stores. This behavior can be extended with custom-defined events and SDK configurations.

To do this perform the following steps:

  1. In your Shopify Admin portal, navigate to Online Store > Themes > Actions > Edit Code
  2. Create an amplitude-options.liquid file in the "Layout" section
  3. Insert the following code template inside this file:
window.amplitudeShopify.customOptions = {
  // custom options definitions
}

Note: Any configurations defined here will be passed onto the underlying JS SDK used by Amplitude's Shopify app (as this also overrides the default options you see in theme.liquid).

Events Taxonomy

This link has the entire tracking plan and event schema in google sheets. You can see which events and properties are automatically sent by default by installing the Shopify App onto your store.

Event

Description

[Shopify] Login

When the user logs into their account

[Shopify] Logout

When the user logs out of their account

[Shopify] Page Viewed

When the user visits any page on the site

[Shopify] Account Created

When the user successfully creates their account

[Shopify] Product Details Viewed

When the user views a product detail page

[Shopify] Product Clicked

When the user has clicked on a product from the collection

[Shopify] Product Added

When the user adds a product to their cart

[Shopify] Cart Viewed

When the user views their cart

[Shopify] Checkout Started

When the user starts the checkout flow

[Shopify] Checkout Completed

When the user completes the checkout

[Shopify] Order Created

When the user’s order is successfully processed and revenue incurred

[Shopify] Order Cancelled

When the user’s order is canceled

[Shopify] Order Updated

When the order is updated by the user

[Shopify] View Thank you Confirmation

When the user receives a thank you confirmation

User Identity

To support a broader range of use cases, our app lets you choose which of the following fields you want to send as the User_Id for known customers.

  1. Email (default) – Recommended when other platforms use the email and can’t hash it, and you are comfortable with the privacy implications.

  2. Hashed email – The MD5 email hash is useful if you have other marketing platforms sending traffic where you know the email of the visitor (e.g. email marketing like Bronto or Marketo), but not their Shopify customer ID.

UTM Tracking

By default, the Shopify Plugin will automatically rely on Amplitude’s JavaScript SDK to pull UTM parameters from the referring URL and include them as user properties on all of the relevant events:

  • includeGclid: Gclid (Google Click Identifier) is a globally unique tracking parameter used by Google. If utilized, Google will append a unique parameter (e.g. "?gclid=734fsdf3") to URLs at runtime. By setting this to true, the SDK will capture initial_glid and gclid as user properties.

  • includeFbclid: Fbclid (Facebook Click Identifier) is a globally unique tracking parameter used by Facebook. If utilized, Facebook will append a unique parameter (e.g. "?fbclid=392foih3") to URLs at runtime. By setting this to true, the SDK will capture initial_fblid and fbclid as user properties.

  • includeUtm: If true, the plugin will find the standard UTM parameters from either the URL or the browser cookie and set them as user properties. This will set utm_source, utm_medium, utm_campaign, utm_term, and utm_content as well as initial_utm_source, initial_utm_medium, initial_utm_campaign, initial_utm_term, and initial_utm_content as user properties for the user.
    UTM parameters are captured once per session by default and occur when the user loads your site and the Amplitude SDK for the first time. When the SDK detects that it should start a new session, it will pull the UTM parameters available at the time. Those UTM parameters will be set as user properties that will persist for all user events going forward. However, initial UTM parameters are captured only once for each user via a setOnce operation.

Cross-Domain Tracking

By default, the Shopify App will automatically track anonymous behavior across two different domains. Anonymous users are identified by their Device IDs which will need to be passed between the domains. For example:

Site 1: www.example.com
Site 2: www.example.org

Users who start on Site 1 and then navigate to Site 2 will have their Device ID generated from Site 1 passed as a parameter to Site 2. Site 2 will then initialize the SDK with that Device ID. The SDK can parse the URL parameter automatically if deviceIdFromUrlParam is enabled.

FAQ

Question

Answer

Does the Amplitude App with Shopify cost anything?

No. The Amplitude app is free to install but you will need either an Amplitude Starter, Growth, or Enterprise plan to start sending data from your Shopify store.

Can I send additional custom events in the future outside the default taxonomy list?

Yes, you can. You will need to partner with your Engineering team to leverage Amplitude’s SDKs to instrument additional events and properties as needed.

What if I need to rename the event names sent by Amplitude’s app?

Using Govern, you can change the display name and description for events, event properties, and user properties. See this guide for more detail. Note all events sent by the Shopify app will have a preheader [Shopify] to distinguish themselves from the custom events sent by your team.

What if I need to block, drop, or filter certain events so that I can use my own custom events instead?

Using Govern, you can block, delete or filter out events and user properties. See this guide for more detail.

Does this Amplitude App interact with third-party apps on the Shopify Marketplace?

No. We have not enabled this functionality.

How can I send data from multiple Shopify stores into Amplitude?

You can use the same project and API key for all the Shopify stores. Alternatively, you can use the API key from multiple projects if you prefer to have a separate project for each of your Shopify stores.

However, with the latter method, if you want to analyze or generate a holistic view of how your users interact with your entire product portfolio, you will need to purchase Amplitude’s Portfolio add-on. Please see this article for more information.


Did this page help you?