Skip to content

Shopify App

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.

Considerations

  • The Shopify integration is available for all Amplitude plans.
  • The 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.
  • 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.
  • Using Govern, you can change the display name and description for events, event properties, and user properties.
  • All events sent by the Shopify app have the preheader [Shopify] to distinguish themselves from the custom events sent by your team.
  • Using Govern, you can block, delete or filter out events and user properties.
  • The Amplitude App doesn't interact with other third-party Shopify apps.
  • If you have more than one Shopify store, you can use the same project and API key all of them. Or, you can use a separate project for each store. If you use separate projects, and 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.
  • Using Amplitude's SDKs, you can send custom events outside the default taxonomy list.

Getting Started

Installation requirements

  • Have an existing online Shopify or Shopify Plus store.
  • Have an Amplitude Starter, Growth, or Enterprise account.

Installation Steps

  1. Go to the Amplitude app in the Shopify app store.
  2. Click Add app to begin the installation process.
  3. Go to your Amplitude project, then navigate to Sources and Destinations > Destinations.
  4. Under Add More Destinations …, click Shopify.
  5. Copy the Amplitude project’s API key.
  6. In the Shopify admin portal, enter the API key in Amplitude API Key field. Then click Connect.
  7. Choose a User_ID for known customers. To support a broader range of use cases, the app lets you choose which of the following fields you want to send as the User_ID for known customers.
  8. Email (default) – Recommended when other platforms use the email and can’t hash it, and you are comfortable with the privacy implications.
  9. 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.
  10. Finally, navigate to Themes > Current Theme > Actions > Edit Code, and check if the Amplitude code snippet is installed. It should be located before the theme’s closing </head> tag in the theme.liquid file. If not, add it.

    <!-- 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 are 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

See 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 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.

  • 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 (fore example, 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 used, Google appends a unique parameter (for example, ?gclid=734fsdf3) to URLs at runtime. By setting this to true, the SDK capture initial_glid and gclid as user properties.
  • includeFbclid: Fbclid (Facebook Click Identifier) is a globally unique tracking parameter used by Facebook. If used, Facebook appends a unique parameter (for example, ?fbclid=392foih3) to URLs at runtime. By setting this to true, the SDK captures initial_fblid and fbclid as user properties.
  • includeUtm: If true, the plugin finds the standard UTM parameters from either the URL or the browser cookie and set them as user properties. This sets 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 automatically tracks anonymous behavior across two different domains. Anonymous users are identified by their Device IDs which must 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 have their Device ID generated from Site 1 passed as a parameter to Site 2. Site 2 then initializes the SDK with that Device ID. The SDK can parse the URL parameter automatically if deviceIdFromUrlParam is enabled.


Last update: 2022-06-03