Integrating your Shopify or Shopify Plus account with Bloomreach Engagement enables you to analyze Shopify data, execute omnichannel marketing campaigns, and use Bloomreach Engagement's AI-driven capabilities on your Shopify store – all that without the need to rely on hundreds of ad-hoc plugins.

Bloomreach Engagement loads customer base, historical orders/purchases, and product catalogs from Shopify and then imports delta product catalogs from Shopify Products API every 4 hours. Bloomreach Engagement also subscribes and listens for new updates on customers and orders from Shopify backend.

Whether it is sending email campaigns, push notifications, creating experiments, or just analyzing your Shopify data, the Bloomreach Engagement Shopify Integration helps the whole process to be as simple and efficient as possible.

Time to complete

Initial Integration: less than 10 Minutes Web Integration: A few days

# Setup process

  1. Log in to your Shopify account and click on the `>` symbol next to **Apps**.


  1. Click on `App and sales channel settings`.

  1. Click on `Develop apps`.

  1. Click on `Allow custom app development` and re-confirm in the next window by clicking on `Allow custom app development` again.

  1. Now go and click `Create an app`.

  1. Complete the field **App name** with a descriptive name (we recommend **Bloomreach Engagement**). Choose a responsible technical person as the **App developer** and insert their email address. Then click on `Create app`.


  1. Go to `API credentials` and click on `Configure Admin API scopes`.


  1. In **Admin API access scopes**, select the required user permissions. Then in **Event version** under **Webhook subscriptions**, choose `2022-7`.

Required user permissions

Required user permissions are: `read_customers`, `read_orders`, and `read_products`.


  1. Now, click on `Install app`. Make sure to keep your tab with **Shopify** open for completing the following steps.

  1. Open Bloomreach Engagement App and go to `Data & Assets > Integrations > + Add new integration` and look up **Shopify**. Next, click on `+ Add integration`.

  1. On the next screen, you will see 4 IDs that need to be set up in your project. Make sure these are set up before you continue and match exactly; ID names are not customizable. You do not need to fill anything in here – just be sure these IDs have been set up. The integration will automatically use these IDs once it starts working.

  1. Now, go back to your **Shopify** tab and copy & paste the `Admin API access token`, `API key`, and `API secret key` from your Shopify account to the matching fields in Bloomreach Engagement under the section Connect project with Shopify.

  1. Now, you can move on to web integration. You will need a technical person to complete the integration by making a few [front-end modifications](🔗). This will take less than a few hours to complete.

  1. After the web integration is complete, the data will start coming in. Events from the API should appear instantly after the setup is finished (remember to click `Save integration`). Regular catalog imports and customer and historical purchase data can be found in Bloomreach Engagement under `Imports`.

  2. Take a coffee break before all the imports are visible, as it might take a while before the whole import is finished.

Shopify Front-end integration for Bloomreach Engagement

[This repository](🔗) contains .liquid snippets that can enable standardized front-end tracking of e-commerce events on your Shopify Plus website.

Using Shopify instead of Shopify Plus

Using the non-Plus version of Shopify does not allow you to customize your checkout page, thus not allowing you to add checkout tracking. This means that Bloomreach Engagement cannot track the checkout steps. Bloomreach Engagement script runs only on the final checkout step; therefore, Bloomreach Engagement cannot personalize the previous checkout process steps.

# SMS Marketing

You can add `sms_marketing_consent` customer property to your existing Shopify integration. The `sms_marketing_consent` is tracked when a customer subscribes or unsubscribes to SMS consent.

To track this new customer property in **real-time**, you need to:

  1. Upgrade Shopify API webhook version to 2022-07

    1. In your Shopify Admin account, go through the following steps: `Settings > Apps and sales channels > Develop apps > Select your existing private app > Review configurations > Edit > Select '2022-07' under Webhook API version > Save changes`.

  2. Go to your Shopify integration page in your Bloomreach Engagement project and click the red button `Upgrade Shopify integration`.

Once you have finished the setup, the `sms_marketing_consent` customer property is available for all your customers.

Relevance for new clients

This action is only relevant for existing Bloomreach Engagement clients as for it is automatically integrated for new clients.

### How to transform customer attributes `sms_marketing_consent` or `email_marketing_consent` into consent events in Bloomreach Engagement?

Shopify manages consents on a profile level. That is the reason why in Bloomreach Engagement, you can see `sms_marketing_consent` or `email_marketing_consent` as a customer attribute and `shopify_consent` event (automatically triggered by Bloomreach). In order to transform them into Bloomreach Engagement consent events (accept or reject) you should set up a transformation scenario in your project to turn `shopify_consent` events into [Consent Management events](🔗). It is advised to double opt-in customers with approved `sms_marketing_consent`, what can be done using the `shopify_consent` event made for this purpose. You can see the example of this action below.

**Alternative 1: Single opt-in**

  1. Define `shopify_consent` as:

  1. Consent event as:

**Alternative 2: Double opt-in**

It is recommended to **always** use a double opt-in approach to follow market regulations and best practices.

To use the double opt-in approach it is required to use opt-in keyword specified in the outbound SMS (e.g. Bloomreach: Reply YES to receive automated marketing messages and cart reminders.) and set the grant action for the specified opt-in keyword in `Project Settings > Campaigns > Channels > SMS/MMS > 2-way SMS / MMS messaging`.

Manually deleting phone for customers in Shopify Admin view

When a customer's phone is removed from Shopify Admin, the `shopify_consent` event is not tracked. This means that the consent scenario is not triggered in Bloomreach Engagement. Unsubscribed customers still have the sms consent given in the Bloomreach Engagement, even if the SMS consent has been removed in Shopify. Note that if you manually remove the phone number or consent in Shopify Admin view, you must also manually do so in Bloomreach Engagement.

# Limitations

Service worker not supported

Shopify **does not support using a service worker** as it prevents installing the service worker into the root folder of Shopify. The root folder is required to install the service worker for web push notifications and non-flickering experiments. Therefore, those two features are not supported out-of-the-box for this integration.

# Technical detail

### What is the latency between an order happening and an order appearing in our app when using our Shopify integration?

The sync is near real-time - Bloomreach Engagement subscribes and listens for new updates on customers and orders from the Shopify backend, resulting in near real-time webhooks.

# Removing Shopify integration

If you decide to remove Shopify integration, please do not remove the webhook from the integration manually before **removing the integration in the application**, as you will not be able to remove the integration afterward. Instead, use only the 'Remove Integration' button in the application. It will take care of all steps required to remove the integration, including deleting the webhook.