
[Shopify](https://www.shopify.com/) is a commerce platform that lets businesses of any size create, customize, and manage online stores. Shopify offers tools for product listings, payments, shipping, and customer engagement, streamlining the selling process online, across social media, and in person.

The [Amplitude Shopify Plugin](https://apps.shopify.com/amplitude) brings data from your Shopify store into Amplitude, unlocking insights from funnel analytics, user behavior trends and charts, ROI analysis, Session Replay, and more.

## How the Shopify plugin works

The Shopify plugin installs a version of the [Amplitude Browser SDK](/docs/sdks/analytics/browser/browser-sdk-2) and adds the script before the `</head>` tag of your site's pages. The script includes [Session Replay](/docs/session-replay) and [Web Experiment](/docs/web-experiment/set-up-a-web-experiment).

{% callout type="note" heading="Guides and Surveys" %}
The Shopify plugin doesn't include [Guides and Surveys](/docs/guides-and-surveys). To use Guides and Surveys on your Shopify store, install the [Guides and Surveys Web SDK](/docs/guides-and-surveys/sdk) separately.
{% /callout %}

{% callout type="warning" heading="Shopify and flickering" %}
The method Shopify uses to load Amplitude's Shopify app causes flickering. To avoid this, add the [asynchronous web script with the anti-flicker snippet](/docs/web-experiment/implementation#async-script-with-anti-flicker-snippet) to your `theme.liquid` file.
{% /callout %}

The Shopify plugin captures Amplitude's default events, including [marketing attribution](/docs/sdks/analytics/browser/browser-sdk-2#track-marketing-attribution) and Shopify's standard [events](https://shopify.dev/docs/api/web-pixels-api/standard-events).

{% accordion title="Shopify plugin events and event properties" %}

| Event                            | Source    | Properties                                                                                                                                                                                                                                                                |
| -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Page viewed                      | Amplitude | Page counter, Page domain, Page location, Page path, Page title, Page URL, Session Replay ID (if enabled), Referrer, [Attribution](/docs/sdks/analytics/browser/browser-sdk-2#track-marketing-attribution), [User properties](/docs/sdks/analytics/browser/browser-sdk-2#user-properties).                                                                          |
| Start session                    | Amplitude | Session Replay ID (if enabled), [User properties](/docs/sdks/analytics/browser/browser-sdk-2#user-properties).                                                                                                                                                                                                      |
| End session                      | Amplitude | [User properties](/docs/sdks/analytics/browser/browser-sdk-2#user-properties).                                                                                                                                                                                                                                      |
| Form started                     | Amplitude | Form destination, Session Replay ID (if enabled), [User properties](/docs/sdks/analytics/browser/browser-sdk-2#user-properties).                                                                                                                                                                                    |
| Form submitted                   | Amplitude | Form destination, Session Replay ID (if enabled), [User properties](/docs/sdks/analytics/browser/browser-sdk-2#user-properties).                                                                                                                                                                                    |
| File downloaded                  | Amplitude | File extension, File name, Link text, Link URL, Session Replay ID (if enabled),                                                                                                                                                                                           |
| Element clicked                  | Amplitude | Element Aria Label, Element Class, Element Hierarchy, Element href, Element ID, Element Parent Label, Element Position Left, Element Position Top, Element Selector, Element Tag, Element Text, Page Title, Page URL, Session Replay ID, Viewport Height, Viewport Width. |
| Element changed                  | Amplitude | Element Class, Element Hierarchy, Element ID, Element Parent Label, Element Position Left, Element Position Top, Element Tag, Page Title, Page URL, Session Replay ID, Viewport Height, Viewport Width.                                                                   |
| Collection viewed                | Shopify   | Collection title                                                                                                                                                                                                                                                          |
| Product viewed                   | Shopify   | Quantity, SKU, Price, Currency Code, Type, Variant Title, Title, Vendor, Products                                                                                                                                                                                         |
| Product added to cart            | Shopify   | Quantity, SKU, Price, Currency Code, Type, Variant Title, Title, Vendor, Products                                                                                                                                                                                         |
| Product removed from cart        | Shopify   | Quantity, SKU, Price, Currency Code, Type, Variant Title, Title, Vendor, Products                                                                                                                                                                                         |
| Checkout started                 | Shopify   | Discounted amount, Total price, Currency code, Products                                                                                                                                                                                                                   |
| Checkout contact info submitted  | Shopify   | --                                                                                                                                                                                                                                                                        |
| Checkout address info submitted  | Shopify   | --                                                                                                                                                                                                                                                                        |
| Checkout shipping info submitted | Shopify   | --                                                                                                                                                                                                                                                                        |
| Checkout completed               | Shopify   | Total tax, Discount amount, Subtotal price, Currency code, Customer id, Products                                                                                                                                                                                          |
| Order created                    | Shopify   | Customer, Products                                                                                                                                                                                                                                                        |
| Search submitted                 | Shopify   | Search query                                                                                                                                                                                                                                                              |

{% /accordion %}

In most scenarios, when a customer completes the checkout flow, Shopify sends the Checkout complete event, then the Order created event. If you create an order manually from your store's Admin page, only the Order created event sends. The Checkout complete event is specific to a customer completing the checkout flow.

Amplitude sets User ID using the email address or phone number the customer enters in the Contact section of the checkout.

{% callout type="note" heading="Shopify checkout page" %}
Shopify prevents third-party packages from loading on your store's checkout page. As a result, Amplitude doesn't receive events from the checkout page, and you can't run experiments on it.
{% /callout %}

### Performance impact

The packages that Amplitude adds to your Shopify pages weigh approximately 167kb. Internal testing showed Lighthouse performance reports averaging 98 without the plugin and 96 with the plugin.

## Install the plugin

The method you use to install the Shopify plugin depends on whether you have an existing Amplitude organization.

### Install without an existing Amplitude organization

1. Find the [Amplitude Shopify plugin](https://apps.shopify.com/amplitude) in the Shopify App Store.
2. Click **Install** and confirm access to add it to your Shopify store.
3. Navigate to the [Amplitude Get Started page](https://analytics.amplitude.com/login?utm_source=shopify_app) and click to create your Amplitude account. Complete the form, agree to terms, and click **Continue**.

{% callout type="note" heading="Data Storage Location" %}
    Amplitude provides data storage in the US and EU. Choose the appropriate option based on your location.
{% /callout %}

4. After you create your account, on the Amplitude setup page, click **Shopify** in the *Other ways to install* section.
5. In the modal, copy your Amplitude project's API key.
6. Return to the Amplitude Settings screen in Shopify, enter the API key, and click **Connect**.

### Install into an existing Amplitude organization

1. Log in to Amplitude and navigate to your organization's settings.
2. Select the project within your organization that you want to connect to Shopify.
3. Find the project's API key and copy it.
4. Return to the Amplitude Settings screen in Shopify, enter the API key, and click **Connect**.

### Configure Session Replay sample rates

1. Log in to Amplitude as a manager and navigate to your organization's settings.
2. Click **Session Replay & Heatmaps** in the sidebar.
3. Select the project that matches the API key you used to install the Shopify app.
4. Input the sample rate you want under the Sampling section.
5. Save the settings.