Skip to content

Shopify standard integration setup

This page walks you through how to integrate Braze with Shopify using our standard integration for users with a Shopify online store. If you use a Shopify headless site or are looking to implement more tailored solutions, refer to Shopify custom integration setup.

Step 1: Connect your Shopify store

  1. In Braze, go to Partner Integrations > Technology Partners and then search for “Shopify”.
  1. On the Shopify partner page, select Begin setup to start the integration process.

    Shopify integration page with button to begin setup.

  2. In the Shopify app store, install the Braze application.

    The Braze app store page with a button to install the application.
  1. After installing the Braze app, you’ll be redirected to Braze to confirm the workspace you want to connect to Shopify. A Shopify store can connect to only one workspace. If you need to switch, select the correct workspace.

    A window asking you to confirm that you’re in the right workspace.
  1. Select Begin setup.

    "Integration settings" with field to enter domain and a button to begin setup.

Step 2: Enable Braze Web SDKs

For Shopify online stores, you can select the standard setup to automatically implement the Braze Web SDK and JavaScript SDK.

“Enable Web SDK” step with options to implement through a standard setup or custom setup.

After you select the standard setup onboarding path, you’ll need to choose when Braze should initialize and load the SDKs from one of the following options:

  • Upon site visit, such as session start
    • Tracks both identified and anonymous users
  • Upon account signup, such as account login
    • Track only identified users
    • Starts tracking data when site visitors sign up or log into their accounts

Step 3: Configure your Shopify data

Standard data setup

Now you’ll select the Shopify data you want to track.

“Tracking Shopify data” section with a checkbox to track behavioral events and user attributes.

The following events will be enabled by default in the standard integration.

For more information on the data tracked through the integration, refer to Shopify Data Features.

Historical backfill setup

Through the standard setup, you have the option to perform an initial load of your Shopify customers and orders from the last 90 days prior to your Shopify integration connection. To do so, select the checkbox to include the initial data load as part of your integration.

Historical data backfill toggle.

This table contains the data that will be initially loaded through the backfill.

As your Shopify customer records are loaded into Braze, the Shopify customer ID will be used as the Braze external ID.

(Advanced) Custom data tracking setup

With the Braze SDKs, you can track custom events or custom attributes that go beyond standard events for this integration. Custom events capture unique interactions in your store, such as:

Custom events Custom attributes
  • Using a custom discount code
  • Interacting with a personalized product recommendation
  • Adding a gift message to their order
  • Favorite brands or products
  • Preferred shopping categories
  • Membership or loyalty status

Tracking custom data helps you gain deeper insights into user behavior and personalize their experience even further. To implement custom events, you need to edit your storefront’s theme code in the theme.liquid file. You may need help from your developers.

For example, the following JavaScript snippet tracks if the current user subscribes to a newsletter, and logs that as a custom event on their profile in Braze:

1
2
3
4
5
6
7
8
9
braze.logCustomEvent(
  “subscribed_to_newsletter”,
  {
    newsletterName: ‘News and Offers’,
    customerEmail: ‘customer_1@gmail.com’,
    sendOffers: true
  }
);

The SDK must be initialized (listening for activity) on a user’s device to log events or custom attributes. To learn more about logging custom data, refer to User object and logCustomEvent object.

Step 4: Configure how you manage users

Select your external_id type from the dropdown.

“Collect subscribers” section.

By default, Braze automatically converts emails from Shopify to lowercase before using them as the external ID. If you’re using email or hashed email as your external ID, confirm that your email addresses are also converted to lowercase before you assign them as your external ID or before hashing them from other data sources. This helps prevent discrepancies in external IDs and avoid creating duplicate user profiles in Braze.

If you selected a custom external ID type, proceed to steps 4.1—4.3. Otherwise, continue to step 4.4.

Step 4.1: Create the braze.external_id metafield

  1. In your Shopify admin panel, go to Settings > Metafields.
  2. Select Customers > Add definition.
  3. For Namespace and key, enter braze.external_id.
  4. For Type, select ID Type.

After the metafield is created, populate it for your customers. We recommend the following approaches:

  • Listen to customer creation webhooks: Set up a webhook to listen for customer/create events. This allows you to write the metafield when a new customer is created.
  • Backfill existing customers: Use the Admin API or Customer API to backfill the metafield for previously created customers.

Step 4.2: Create an endpoint to retrieve your external ID

You need to create a public endpoint that Braze can call to retrieve the external ID. This is necessary for scenarios where Shopify can’t provide the braze.external_id metafield.

Endpoint specifications

Method: GET

Example endpoint

1
2
GET 
https://mystore.com/custom_id?shopify_customer_id=1234&[email protected]&shopify_storefront=dev-store.myshopify.com

Expected response

Braze expects a 200 status code. Any other code is considered a failure.

1
2
3
{ 
    "external_id": "my_external_id" 
}

Step 4.3: Input your external ID

Repeat Step 4, and enter your endpoint URL after selecting custom external ID as your Braze external ID type.

Considerations

  • If your external ID isn’t generated when Braze sends a request to your endpoint, the integration will default to using the Shopify customer ID when the changeUser function is called. This step is crucial for merging the anonymous user profile with the identified user profile. As a result, there may be a temporary period during which different types of external IDs exist within your workspace.
  • When the external ID is available in the braze.external_id metafield, the integration will prioritize and assign this external ID.
    • If the Shopify customer ID was previously set as the Braze external ID, it will be replaced with the braze.external_id metafield value.

Step 4.4: Collect your email or SMS opt-ins from Shopify (optional)

You have the option to collect your email or SMS marketing opt-ins from Shopify.

If you use the email or SMS channels, you can sync your email and SMS marketing opt-in states into Braze. If you sync email marketing opt-ins from Shopify, Braze will automatically create an email subscription group for all users associated with that specific store. You need to create a unique name for this subscription group.

“Collect subscribers” section with option to collect email or SMS marketing opt-ins.

Step 5: Sync products (optional)

You can sync all products from your Shopify store to a Braze catalog for deeper messaging personalization. Automatic updates occur in near real-time so your catalog always reflects the latest product details. To learn more, check out Shopify product sync.

Step 4 of the set up process with "Shopify Variant ID" as the "Catalog product identifier".

Step 6: Activate Channels (optional)

You can enable in-app messages without using a developer by configuring them in your setup.

Setup step to activate channels, with the available option being in-browser messaging.

Supporting additional SDK channels

The Braze SDKs enable various messaging channels, including Content Cards.

Content Cards and Feature Flags

To add content cards or feature flags, you will need to collaborate with your developers to insert the necessary SDK code directly into your theme.liquid file. For detailed instructions, refer to Integrating the Braze SDK.

Web push notifications

Web push currently isn’t supported for the Shopify integration. If you want to see this supported in the future, submit a product request through the Braze product portal.

If you wish to see this supported in the future, submit a product request through the Braze product portal.

Step 7: Finish setup

  1. After you configure your setup, select Finish Setup.
  2. Enable the Braze app embed within your Shopify theme settings. Select Open Shopify to be redirected to your Shopify account to enable the app embed within your store’s theme settings.

Banner that says you need to active the Braze app embed in Shopify and contains a button to open Shopify.

  1. After you enable the app embed, your setup is complete! Confirm you can view your integration settings, the status of initial data sync, and your active Shopify events.

    Shopify partner page displaying the integration settings.
HOW HELPFUL WAS THIS PAGE?
New Stuff!