Shopify and Shopify Plus

By connecting your Shopify or Shopify Plus account to Bloomreach Engagement, you can easily analyze your Shopify data, run marketing campaigns across multiple channels, and use Bloomreach Engagement's advanced AI features on your Shopify store. No more dealing with numerous plugins!

Bloomreach Engagement retrieves customer information, past orders, and product catalogs from Shopify, and it regularly imports the delta product catalogs in real time. It also stays connected to Shopify to receive real-time updates on customers and orders.

📘

Time to complete

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

How is the integration useful

With the Bloomreach Engagement Shopify Integration, you can effortlessly send emails, and push notifications, create experiments, and gain valuable insights from your Shopify data analysis. It simplifies the entire process and makes it more efficient.

Instead of having to depend on external plugins, the Shopify integration allows for a simple plug-and-play transition.

  • You can set up a straightforward and uncomplicated way to analyze your Shopify data and use them to boost your marketing campaigns.
  • You do not have to deal with external plugins for integrating my Shopify data with Bloomreach Engagement.
  • You can integrate your Shopify data with Bloomreach Engagement in the most efficient way.

How the integration works

After you set up the integration, Bloomreach Engagement downloads historical data (data up to that point) and subsequently tracks new data (changes, additions, etc.) from the Shopify API:

Initial data load

Bloomreach Engagement loads customer base, historical orders or purchases, and product catalogs from Shopify:

  • Initial load of all events from the beginning until the time when webhooks were added
  • Events loaded from Shopify: purchase, purchase_item, cart_update
  • Customer attributes loaded from Shopify: personal information, accepts_marketing
  • Catalogs: products and variants

Real time imports

Bloomreach Engagement imports delta product catalogs from Shopify Products API in real time.

📘

Real Time Imports for New Integrations

All new integrations with Shopify import data to Bloomreach Engagement in real time.

However, older integrations have updates of imports every 4 hours.

Near real-time webhooks

Bloomreach Engagement subscribes for new updates on customers and orders from the Shopify backend.

Webhook registration

Bloomreach Engagement registers webhooks to receive real-time tracking and customer updates from Shopify.

Webhooks processing

Bloomreach Engagement processes real-time tracking:

  • customer create/update attributes/deletion (track customer_updated)
  • purchase events
  • cart_create, cart_update

Setup process

1. Add new integration

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

2. Prerequisites

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.

📘

A project needs to have the following IDs set up:

  • email_id - Hard ID, lowercase, trim; email address is the primary identifier for a customer in Bloomreach Engagement ⓘ If there are multiple Shopify customers with the same email address, there is one customer for Bloomreach Engagement
  • shopify_id - Soft ID - numeric Shopify Customer identifier ⓘ one customer can have more values if multiple Shopify stores are integrated into one Bloomreach Engagement project
  • cart_id - Soft ID - an alphanumeric token of a shopping cart for purposes of cartupdate tracking ⓘ _the cart_id is used to match Shopify carts with Bloomreach Engagement customers
  • cookie - Soft ID - device unique cookie identifier ⓘ standard cookie identifier that is used in web tracking

🚧

Shopify integration does not use the default "registered" as its ID. Setting up a project without a "registered" ID is recommended. If the project has this ID, it will be ignored, but it is better to create a new project without "registered" if possible.

3. Authentication

To connect your project with Shopify, there are two ways how to authenticate with Shopify and allow the data to flow successfully:

  • Official app (Shopify App Store) - recommended
  • Custom app

Official App

  1. After reviewing the prerequisites, connect your project with Shopify via the Official App. To generate Encrypted credentials, click on the official App in the Shopify App Store link, which redirects you to the Shopify App Store.

  1. Click on Add app, then approve permissions by clicking the Install app button.
  1. To connect your Shopify account with Bloomreach Engagement, click the Reveal token button and copy and paste it into the Encrypted credentials field in Bloomreach Engagement.

  1. Click the Save integration button to complete your integration.

Custom app

  1. Log in to your Shopify account and click on the > symbol next to Apps.
526
  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.
1284
  1. Go to API credentials and click on Configure Admin API scopes.
1194
  1. In Admin API access scopes, select the required user permissions. Then in Event version under Webhook subscriptions, choose 2023-10.

📘

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

4. Web integration

In order to start tracking fronted events (view_item, view_category etc.), it is needed to integrate it via one of these two methods:

  • Shopify Web Pixel - recommended
  • Custom Web Integration

📘

Support of Checkout tracking

Please note that due to changes on Shopify's side, checkout tracking is supported only by the Shopify Web Pixel.

Shopify Web Pixel

📘

Prerequisites

Shopify Web Pixel is part of our official app in the Shopify App Store. That's why this method is supported only via the Authorization method through the Official App (Shopify App Store).

A single store can only have one web-pixel integration. This usually means 1 project = 1 integration = 1 pixel. You won't be able to create 2 web pixel integrations on the same store (and the same app).

Integrating with Web Pixel will take you only two steps to enable it, which takes only few minutes to set up.

1. Insert Bloomreach snippet into Shopify

Fist and only precondition is to insert Bloomreach Web Integration snippet inside your Shopify store. To do so you need to go to the Themes tab of your Shopify store and click on ⋯ Edit code.

Open the theme.liquid file...

Now go to your project in Bloomreach and click on Web integration.

Decide whether you want to tack page_visit events. If yes, tick the relevant checkbox.

Additionally, add the following line to the script. Place it below the "token" parameter and ensure they are on the same hierarchical level.

data_layer: true,

This is an example of the Web Integration snippet (Target and Token need to be provided):

Copy the snippet and paste it inside the <head>section inside your theme.liquid file

As a last step, paste paste the following code above the Web integration snippet inside the <head> section inside your theme.liquid file:

<script>
  window.dataLayer = window.dataLayer || [];

  function subscribeCookieListener(dataLayer) {
    // Step to process information already existing in the datalayer
    dataLayer.forEach(processDatalayerEvent)

    // Set-up a "listener"
    const originalPush = dataLayer.push;
    dataLayer.push = function() {
        originalPush.apply(dataLayer, arguments);
        Array.from(arguments).forEach(processDatalayerEvent);
    };
  
  }
subscribeCookieListener(window.dataLayer);

function processDatalayerEvent(event){
  if(event.event === "bre.cookie"){
    Shopify.analytics.publish("bre.cookie",event);
  }
}
 
</script>

2. Finish the web integration

Enable the flows you want to track.

Save the changes in the liquid.file and your Web Integration is done!

Custom Web Integration

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.

📘

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.

How to switch from the Custom Web Integration to Shopify Web Pixel

In order to switch to Web Pixel tracking, remove the Exponea scripts inserted to Shopify liquids during the Custom Web Integration installation. Find the Custom Web Integration installation guide here. These are the files that might contain some tracking snippets, depending on your custom configuration:

  • product.liquid
  • collection.liquid
  • search.liquid
  • theme.liquid
  • checkout.liquid

To find them, go to the Themes tab of your Shopify store.

Click Edit Code.

After that, you need to navigate to Theme Liquid and paste the new Bloomreach Web Integration snippets. For more details on how to do it, please check the instructions in the section above.

As soon as the theme liquid is updated, navigate to the Bloomreach App and accept new scopes by pressing the upgrade button. Now you can enable the Web Pixel Integration on your Shopify integration page. Don't forget to save the changes at the end. This is related to existing integrations created via the offcial app.


In case your integration was created via a custom App, you need to do the reauthorization and installation of the official Bloomreach Eamil&SMS marketing app.

For that, navigate to your existing Shopify integration page and click the the Reauthorize button.

Navigate to your Shopify store, install the Official Bloomreach Eamil&SMS marketing app (Shopify App Store), and paste the revealed token into the Encrypted credentials field in Bloomreach Engagement.

At the end, save changes.


📘

Main changes between Custom Web integration and Shopify Web Pixel

  1. attributes not tracked by webpixel:
  • view_category: browser, device, location and os

  • view_item: browser, device, location and os

  • search: browser, device, location and os

  • checkout: browser, device, location and os

  1. Checkout event is triggered when any of the checkout steps is changed: checkout_started, checkout_contact_info_submitted, checkout_address_info_submitted, checkout_shipping_info_submitted, checkout_completed

  2. In the checkout event the step_title attribute is changed to be representative of the checkout state, so for example step_title thankyou becomes checkout_completed.
    We take these step_title attributes from checkout event names.

5. Save the integration

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.

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

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 2023-10
    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 '2023-10' 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.
  1. 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.