Skip to content

Shopify カスタム統合設定

このページでは、カスタムストアフロントを使用して、Shopify Hydrogen ストアやヘッドレス Shopify ストアと Braze を統合する方法を説明します。

このガイドでは、Shopify の Hydrogen フレームワークを例にしています。ただし、ブランドが「ヘッドレス」フロントエンド設定でストアのバックエンドに Shopify を使用している場合も、同様のアプローチをとることができます。

Shopify のヘッドレスストアを Braze と統合するには、以下の2つの目標を達成する必要があります。

  1. Braze Web SDK を初期化してロードし、オンサイトトラッキングを有効にする

    手動で Shopify Web サイトにコードを追加して、Braze オンサイトトラッキングを有効にします。Shopify ヘッドレスストアに Braze SDK を実装することで、セッション、匿名のユーザー行動、チェックアウト前のショッパーアクション、そして開発チームと一緒に選択したカスタムイベントカスタム属性を含むオンサイトアクティビティをトラッキングできます。また、アプリ内メッセージやコンテンツカードなど、SDK がサポートするチャネルを追加することもできます。
  1. Braze の Shopify 統合をインストールする

    Shopify ストアを Braze に接続すると、Shopify の Webhook を通じて顧客、チェックアウト、注文、商品データにアクセスできるようになります。

これらの目標を達成するには、以下のステップに従ってください。

Braze Web SDK を初期化してロードする

ステップ 1: Braze Web サイトアプリを作成する

Braze で、[設定] > [アプリの設定] に移動し、[アプリの追加] を選択します。アプリ名に「Shopify」と入力します。

ステップ 2: サブドメインおよび環境変数の追加

  1. Shopify サブドメインをオンラインストアから Hydrogen にトラフィックをリダイレクトするように設定します。
  2. ログイン用のコールバック URI を追加します。(ドメインが追加されると、URI は自動的に追加されます。)
  3. Shopify 環境変数を設定します。
    • ステップ 1 で作成した Web サイトアプリの値を使用して、次の 2 つの環境変数を作成します。
    • BRAZE_API_KEY
    • BRAZE_API_URL

ステップ 3: オンサイトトラッキングを有効にする

まず、Braze Web SDK を初期化します。NPM パッケージをインストールすることをお勧めします。

1
2
3
npm install --save @braze/web-sdk@5.4.0
# or, using yarn:
# yarn add @braze/web-sdk

次に、最上位キーとしてこの設定vite.config.js ファイルに含めます。

1
2
3
optimizeDeps: {
    exclude: ['@braze/web-sdk']
}

NPM パッケージをインストールした後、Layout コンポーネント内部の useEffect フック内で SDK を初期化する必要があります。Hydrogen のバージョンに応じて、このコンポーネントは root.jsx または layout.jsx のいずれかのファイルにあります。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Add these imports
import * as braze from "@braze/web-sdk";
import { useEffect } from 'react';

export function Layout({children}) {
  const nonce = useNonce();
  // @type {RootLoader} 
  const data = useRouteLoaderData('root');
  
  // Add useEffect call to initialize Braze SDK
  useEffect(() => {
    if(!braze.isInitialized()) {
      braze.initialize(data.brazeApiKey, {
        baseUrl: data.brazeApiUrl,
      });
      braze.openSession()    
    }
  }, [data]) 

  return (...);
}

ステップ 2 で作成した環境変数を使用して、値 data.brazeApiKeydata.brazeApiUrl をコンポーネントローダーに含める必要があります。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export async function loader(args) {
  // Start fetching non-critical data without blocking time to first byte
  const deferredData = loadDeferredData(args);

  // Await the critical data required to render initial state of the page
  const criticalData = await loadCriticalData(args);

  const {storefront, env} = args.context;

  return {
    ...deferredData,
    ...criticalData,
    publicStoreDomain: env.PUBLIC_STORE_DOMAIN,
    // Add the two properties below to the returned value
    brazeApiKey: env.BRAZE_API_KEY,
    brazeApiUrl: env.BRAZE_API_URL,
    shop: getShopAnalytics({
      storefront,
      publicStorefrontId: env.PUBLIC_STOREFRONT_ID,
    }),
    consent: {
      checkoutDomain: env.PUBLIC_CHECKOUT_DOMAIN,
      storefrontAccessToken: env.PUBLIC_STOREFRONT_API_TOKEN,
      withPrivacyBanner: false,
      // Localize the privacy banner
      country: args.context.storefront.i18n.country,
      language: args.context.storefront.i18n.language,
    },
  };
}

ステップ 4: Shopify アカウントログインイベントの追加

買い物客がアカウントにサインインし、ユーザー情報を Braze に同期したタイミングを追跡します。これには、changeUser メソッドを呼び出して、Braze external ID で顧客を識別することが含まれます。

開始する前に、Hydrogen 内で顧客ログインが動作するようにコールバック URI が設定されていることを確認してください。詳細については、Using the Customer Account API with Hydrogen を参照してください。

  1. コールバック URI を設定した後、Braze SDK を呼び出す関数を定義します。新しいファイル(Tracking.jsx など)を作成し、コンポーネントからインポートします。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import * as braze from "@braze/web-sdk";

export function trackCustomerLogin(customerData, storefrontUrl) {
  const customerId = customerData.id.substring(customerData.id.lastIndexOf('/') + 1)
  const customerSessionKey = `ab.shopify.shopify_customer_${customerId}`;
  const alreadySetCustomerInfo = sessionStorage.getItem(customerSessionKey);
  
  if(!alreadySetCustomerInfo) {
    const user = braze.getUser()

    // To use Shopify customer ID as Braze External ID, use:
    // braze.changeUser(customerId)

    // To use Shopify customer email as Braze External ID, use:
      // braze.changeUser(customerData.emailAddress?.emailAddress)
        // To use hashing for email addresses, apply hashing before calling changeUser

    // To use your own custom ID as the Braze External ID, pass that value to the changeUser call.

    user.setFirstName(customerData.firstName);
    user.setLastName(customerData.lastName);
    if(customerData.emailAddress.emailAddress) {
      user.setEmail(customerData.emailAddress?.emailAddress);
    }

    if(customerData.phoneNumber?.phoneNumber) {
      user.setPhoneNumber(customerData.phoneNumber?.phoneNumber);
    }
    braze.logCustomEvent(
      "shopify_account_login",
      { source: storefrontUrl }
    )
    sessionStorage.setItem(customerSessionKey, customerId);
  }
}
  1. Braze SDK を初期化するのと同じ useEffect フックで、この関数の呼び出しを追加します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { trackCustomerLogin } from './Tracking';

export function Layout({children}) {
  const nonce = useNonce();
  // @type {RootLoader}
  const data = useRouteLoaderData('root');

  useEffect(() => {
    if(!braze.isInitialized()) {
      braze.initialize(data.brazeApiKey, {
        baseUrl: data.brazeApiUrl,
        enableLogging: true,
      });
      braze.openSession()    
    }

    // Add call to trackCustomerLogin function
    data.isLoggedIn.then((isLoggedIn) => {
      if(isLoggedIn) {
        trackCustomerLogin(data.customerData, data.publicStoreDomain)
      }
    })

  }, [data])
  1. ファイル app/graphql/customer-account/CustomerDetailsQuery.js にある Customer API GraphQL クエリで、顧客のメールアドレスと電話番号を取得します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
export const CUSTOMER_FRAGMENT = `#graphql
  fragment Customer on Customer {
    id
    firstName
    lastName
    emailAddress {
      emailAddress
    }
    phoneNumber {
      phoneNumber
    }
    defaultAddress {
      ...Address
    }
    addresses(first: 6) {
      nodes {
        ...Address
      }
    }
  }
  fragment Address on CustomerAddress {
    id
    formatted
    firstName
    lastName
    company
    address1
    address2
    territoryCode
    zoneCode
    city
    zip
    phoneNumber
  }
`;
  1. 最後に、ローダー関数で顧客データを読み込みます。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Add import for GraphQL Query 
import { CUSTOMER_DETAILS_QUERY } from './graphql/customer-account/CustomerDetailsQuery';

export async function loader(args) {
  // Start fetching non-critical data without blocking time to first byte
  const deferredData = loadDeferredData(args);

  // Await the critical data required to render initial state of the page
  const criticalData = await loadCriticalData(args);

  const {storefront, env} = args.context;

  // Add GraphQL call to Customer API
  const isLoggedIn = await deferredData.isLoggedIn;
  let customerData;
  if (isLoggedIn) {
    const { data, errors } = await args.context.customerAccount.query(
        CUSTOMER_DETAILS_QUERY,
    );
    customerData = data.customer
  } else {
    customerData = {}
  }

  return {
    ...deferredData,
    ...criticalData,
    publicStoreDomain: env.PUBLIC_STORE_DOMAIN,
    brazeApiKey: env.BRAZE_API_KEY,
    brazeApiUrl: env.BRAZE_API_URL,
    // Add the property below to the returned value 
    customerData: customerData,
    shop: getShopAnalytics({
      storefront,
      publicStorefrontId: env.PUBLIC_STOREFRONT_ID,
    }),
    consent: {
      checkoutDomain: env.PUBLIC_CHECKOUT_DOMAIN,
      storefrontAccessToken: env.PUBLIC_STOREFRONT_API_TOKEN,
      withPrivacyBanner: false,
      // Localize the privacy banner
      country: args.context.storefront.i18n.country,
      language: args.context.storefront.i18n.language,
    },
  };
}

ステップ 5: 製品の閲覧イベントとカートの更新イベントのトラッキングを追加する

製品の閲覧イベント

  1. この関数を Tracking.jsx ファイルに追加します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export function trackProductViewed(product, storefrontUrl) {
  const eventData = {
    product_id: product.id.substring(product.id.lastIndexOf('/') + 1),
    product_name: product.title,
    variant_id: product.selectedOrFirstAvailableVariant.id.substring(product.selectedOrFirstAvailableVariant.id.lastIndexOf('/') + 1),
    image_url: product.selectedOrFirstAvailableVariant.image?.url,
    product_url: `${storefrontUrl}/products/${product.handle}`,
    price: product.selectedOrFirstAvailableVariant.price.amount,
    currency: product.selectedOrFirstAvailableVariant.price.currencyCode,
    source: storefrontUrl,
    type: ["price_drop", "back_in_stock"],
    metadata: {
    sku: product.selectedOrFirstAvailableVariant.sku
  }

  }
  braze.logCustomEvent(
    "ecommerce.product_viewed",
    eventData 
  )
}
  1. ユーザーが製品ページにアクセスするたびにこの関数を呼び出すには、ファイル app/routes/products.$handle.jsx 内の Product コンポーネントに useEffect フックを追加します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { trackProductViewed } from '~/tracking';
import { useEffect } from 'react';

export default function Product() {
  // @type {LoaderReturnData} 
  // retrieve storefrontUrl to be passed into trackProductViewed 
  const {product, storefrontUrl} = useLoaderData();
  
  // Add useEffect hook for tracking product_viewed event 
  useEffect(() => {
    trackProductViewed(product, storefrontUrl)
  }, [])

  return (...)
}
  1. 「storefrontUrl」の値を追加します(デフォルトではコンポーネントローダーに含まれていないため)。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
async function loadCriticalData({context, params, request}) {
  const {handle} = params;
  const {storefront} = context;

  if (!handle) {
    throw new Error('Expected product handle to be defined');
  }

  const [{product}] = await Promise.alll([
    storefront.query(PRODUCT_QUERY, {
      variables: {handle, selectedOptions: getSelectedProductOptions(request)},
    }),
    // Add other queries here, so that they are loaded in parallel
  ]);

  if (!product?.id) {
    throw new Response(null, {status: 404});
  }

  return {
    product,
   // Add this property to the returned value
    storefrontUrl: context.env.PUBLIC_STORE_DOMAIN,
  };
}

カート更新イベント

  1. cart_updated イベントを追跡し、カートトークンを設定する関数を定義します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export function trackCartUpdated(cart, storefrontUrl) {
  const eventData = {
    cart_id: cart.id,
    total_value: cart.cost.totalAmount.amount,
    currency: cart.cost.totalAmount.currencyCode,

    products: cart.lines.nodes.map((line) => {
      return {
        product_id: line.merchandise.product.id.toString(),
        product_name: line.merchandise.product.title,
        variant_id: line.merchandise.id.toString(),
        image_url: line.merchandise.image.url,
        product_url: `${storefrontUrl}/products/${line.merchandise.product.handle}`,
        quantity: Number(line.quantity),
        price: Number(line.cost.totalAmount.amount / Number(line.quantity))
      }
    }),
    source: storefrontUrl,
    metadata: {},
  };
  
  braze.logCustomEvent(
    "ecommerce.cart_updated",
    eventData 
  )
}

export function setCartToken(cart) {
  const cartId = cart.id.substring(cart.id.lastIndexOf('/') + 1) 
  const cartToken = cartId.substring(0, cartId.indexOf("?key="));
  if (cartToken) {
    const cartSessionKey = `ab.shopify.shopify_cart_${cartToken}`;
    const alreadySetCartToken = sessionStorage.getItem(cartSessionKey);

    if (!alreadySetCartToken) {
      braze.getUser().addAlias("shopify_cart_token", `shopify_cart_${cartToken}`)
      braze.requestImmediateDataFlush();
      sessionStorage.setItem(cartSessionKey, cartToken);
    }
  }
}
  1. フェッチャーアクションから cart オブジェクトを返し、Braze がそのプロパティにアクセスできるようにします。app/routes/cart.jsx ファイルに移動して、action 関数に以下を追加します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
export async function action({request, context}) {
  const {cart} = context;

  ...

  switch (action) {
    case CartForm.ACTIONS.LinesAdd:
      result = await cart.addLines(inputs.lines);
      break;
    ... 
  }

  const cartId = result?.cart?.id;
  const headers = cartId ? cart.setCartId(result.cart.id) : new Headers();
  const {cart: cartResult, errors, warnings} = result;

  const redirectTo = formData.get('redirectTo') ?? null;
  if (typeof redirectTo === 'string') {
    status = 303;
    headers.set('Location', redirectTo);
  }
  
  return data(
    {
      cart: cartResult,
      // Add these two properties to the returned value 
      updatedCart: await cart.get(),
      storefrontUrl: context.env.PUBLIC_STORE_DOMAIN,
      errors,
      warnings,
      analytics: {
        cartId,
      },
    },
    {status, headers},
  );
}

Remix フェッチャーの詳細については、useFetcher を参照してください。

  1. Hydrogen ストアは通常、カートオブジェクトの状態を管理する CartForm コンポーネントを定義します。このコンポーネントは、カート内のアイテムの追加、削除、数量の変更時に使用されます。フォームフェッチャーの状態が変わるたびに(ユーザーカートが更新されるたびに)trackCartUpdated 関数を呼び出す useEffect フックを AddToCartButton コンポーネントに追加します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Add imports 
import { trackCartUpdated, setCartToken } from '~/tracking';
import { useEffect } from 'react';
import { useFetcher } from '@remix-run/react';

export function AddToCartButton({
  analytics,
  children,
  disabled,
  lines,
  onClick,
}) {
	
  // Define a new Fetcher to be used for tracking cart updates 
  const fetcher = useFetcher({ key: "cart-fetcher" });
  
  // Add useEffect hook for tracking cart_updated event and setting cart token alias
  useEffect(() => {
    if(fetcher.state === "idle" && fetcher.data) {
      trackCartUpdated(fetcher.data.updatedCart, fetcher.data.storefrontUrl)
      setCartToken(fetcher.data.updatedCart);
    }
  }, [fetcher.state, fetcher.data])

  // Add the fetcherKey prop to the CartForm component
  return (
    <CartForm route="/cart" inputs= fetcherKey="cart-fetcher" action={CartForm.ACTIONS.LinesAdd}>
      {(fetcher) => (
        <>
          <input
            name="analytics"
            type="hidden"
            value={JSON.stringify(analytics)}
          />
          <button
            type="submit"
            onClick={onClick}
            disabled={disabled ?? fetcher.state !== 'idle'}
          >
            {children}
          </button>
        </>
      )}
    </CartForm>
  );
}
  1. カートから既存の製品を更新するアクションには、同じ fetcherKey を使用します。CartLineRemoveButtonCartLineUpdateButton コンポーネント(デフォルトではファイル app/components/CartLineItem.jsx にある)に以下を追加します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function CartLineRemoveButton({lineIds, disabled}) {
  // Add the fetcherKey prop to the CartForm component
  return (
    <CartForm
      fetcherKey="cart-fetcher"
      route="/cart"
      action={CartForm.ACTIONS.LinesRemove}
      inputs=
    >
      <button disabled={disabled} type="submit">
        Remove
      </button>
    </CartForm>
  );
}

function CartLineUpdateButton({children, lines}) {
  // Add the fetcherKey prop to the CartForm component
  return (
    <CartForm
      route="/cart"
      fetcherKey="cart-fetcher"
      action={CartForm.ACTIONS.LinesUpdate}
      inputs=
    >
      {children}
    </CartForm>
  );
}

Braze の Shopify 統合をインストールする

ステップ 1: Shopify ストアを接続する

Shopify パートナーページに移動して設定を開始します。まず、[Begin Setup] を選択し、Shopify App Store から Braze アプリケーションをインストールします。ガイドの手順に従って、インストールプロセスを完了します。

Braze ダッシュボードの Shopify 統合設定ページ。

ステップ 2: Braze SDK を有効にする

Shopify Hydrogen またはヘッドレスストアの場合は、[カスタム設定] オプションを選択します。

オンボーディングプロセスを続行する前に、Shopify Web サイトで Braze SDK が有効になっていることを確認してください。

Braze SDK を有効にする設定ステップ。

ステップ 3: Shopify データを追跡する

Shopify の Webhook を利用する Shopify イベントと属性をさらに追加することで、統合を強化します。この統合で追跡されるデータの詳細については、Shopify Data Features を参照してください。

Shopify データ追跡の設定ステップ。

ステップ 4: 履歴バックフィル(オプション)

カスタム設定を通じて、Shopify 統合を接続する前の過去 90 日間の Shopify 顧客と注文を読み込むオプションがあります。この初期データ読み込みを含めるには、初期データ読み込みオプションのチェックボックスをオンにします。

後でバックフィルを実行する場合は、ここで初期セットアップを完了し、後からこのステップに戻ることができます。

履歴データのバックフィルを設定するセクション。

この表には、バックフィルによって最初に読み込まれるデータが掲載されています。

ステップ 5: カスタムデータトラッキングの設定(上級)

Braze SDK を使用すると、この統合でサポートされているデータを超えるカスタムイベントやカスタム属性を追跡できます。カスタムイベントは、以下のようなストアでの固有のインタラクションをキャプチャします。

カスタムイベント カスタム属性
  • カスタム割引コードの使用
  • パーソナライズされたおすすめ商品とのインタラクション
  • お気に入りのブランドまたは製品
  • 優先ショッピングカテゴリ
  • メンバーシップまたはロイヤルティステータス

イベントやカスタム属性をログに記録するには、SDK がユーザーのデバイス上で初期化(アクティビティをリッスン)されている必要があります。カスタムデータのロギングについては、User objectlogCustomEvent を参照してください。

ステップ 6: ユーザーの管理方法の設定(オプション)

ドロップダウンから external_id タイプを選択します。

「サブスクライバーの収集」セクション。

デフォルトでは、Braze は Shopify から取得したメールを自動的に小文字に変換してから external ID として使用します。メールまたはハッシュメールを external ID として使用している場合は、external ID として割り当てる前、または他のデータソースからハッシュする前に、メールアドレスも小文字に変換されていることを確認してください。これにより、external ID の不一致を防ぎ、Braze での重複ユーザープロファイルの作成を回避できます。

ステップ 6.1: braze.external_id メタフィールドを作成する

  1. Shopify の管理パネルで、Settings > Metafields に移動します。
  2. Customers > Add definition を選択します。
  3. Namespace and keybraze.external_id と入力します。
  4. TypeID Type を選択します。

メタフィールドが作成されたら、顧客に対して値を入力します。次のアプローチをお勧めします。

  • 顧客作成 Webhook をリッスンする: customer/create イベントをリッスンする Webhook を設定します。これにより、新しい顧客の作成時にメタフィールドを書き込むことができます。
  • 既存の顧客をバックフィルする: Admin API または Customer API を使用して、以前に作成した顧客のメタフィールドをバックフィルします。

ステップ 6.2: external ID を取得するエンドポイントを作成する

Braze が external ID を取得するために呼び出せる公開エンドポイントを作成する必要があります。これにより、Shopify が braze.external_id メタフィールドを直接提供できないシナリオでも、Braze が ID を取得できます。

エンドポイント仕様

メソッド: GET

Braze は、次のパラメーターをエンドポイントに送信します。

サンプルエンドポイント
1
GET https://mystore.com/custom_id?shopify_customer_id=1234&[email protected]&shopify_storefront=dev-store.myshopify.com
期待される応答

Braze は、external ID の JSON を返す 200 ステータスコードを期待します。

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

shopify_customer_idemail_address(存在する場合)が Shopify の顧客値と一致することを検証することが重要です。Shopify Admin API または Customer API を使用してこれらのパラメーターを検証し、正しい braze.external_id メタフィールドを取得できます。

失敗時の動作とマージ

200 以外のステータスコードは失敗と見なされます。

  • マージへの影響: エンドポイントが失敗した場合(200 以外を返す、またはタイムアウトした場合)、Braze は external ID を取得できません。そのため、Shopify ユーザーと Braze ユーザープロファイル間のマージは、その時点では行われません。
  • 再試行ロジック: Braze は標準的な即時ネットワーク再試行を試みますが、失敗が続く場合、マージは次の該当イベントまで延期されます(たとえば、次回ユーザーがプロファイルを更新するか、チェックアウトを完了したとき)。
  • サポート性: タイムリーなユーザーマージに対応するには、エンドポイントの高可用性を確保し、オプションの email_address フィールドを適切に処理するようにしてください。

ステップ 6.3: external ID を入力する

ステップ 6 を繰り返し、Braze の external ID タイプとしてカスタム external ID を選択した後、エンドポイント URL を入力します。

考慮事項
  • Braze がエンドポイントにリクエストを送信したときに external ID が生成されていない場合、changeUser 関数が呼び出されると、統合はデフォルトで Shopify 顧客 ID を使用します。このステップは、匿名ユーザープロファイルと識別済みユーザープロファイルをマージするために重要です。そのため、一時的にワークスペース内にさまざまなタイプの external ID が存在する場合があります。
  • external ID が braze.external_id メタフィールドで使用可能な場合、統合はこの external ID を優先して割り当てます。
    • 以前に Shopify 顧客 ID が Braze external ID として設定されていた場合は、braze.external_id メタフィールドの値に置き換えられます。

ステップ 6.4: Shopify からメールや SMS のオプトインを収集する(オプション)

Shopify からメールまたは SMS マーケティングのオプトインを収集するオプションもあります。

メールや SMS チャネルを使用している場合、メールや SMS マーケティングのオプトイン状態を Braze に同期できます。Shopify からメールマーケティングオプトインを同期すると、Braze はその特定のストアに関連付けられたすべてのユーザーのメールサブスクリプショングループを自動的に作成します。このサブスクリプショングループに一意の名前を作成する必要があります。

「サブスクライバーの収集」セクションで、メールまたは SMS マーケティングのオプトインを収集するオプションがあります。

ステップ 7: 製品を同期する(オプション)

Shopify ストアの全商品を Braze カタログに同期し、より詳細なメッセージングのパーソナライゼーションを実現できます。自動更新はほぼリアルタイムで行われるため、カタログには常に最新の商品詳細が反映されます。詳細については、Shopify product sync を参照してください。

商品データを Braze に同期する設定ステップ。

ステップ 8: チャネルを有効にする

Shopify 直接統合を使用してアプリ内メッセージ、コンテンツカード、およびフィーチャーフラグを有効にするには、各チャネルを SDK に追加します。以下の各チャネルのドキュメントリンクに従ってください。

  • アプリ内メッセージ: リード獲得フォームのユースケースでアプリ内メッセージを有効にするには、アプリ内メッセージを参照してください。
  • コンテンツカード: 受信トレイや Web サイトバナーのユースケースでコンテンツカードを有効にするには、コンテンツカードを参照してください。
  • フィーチャーフラグ: サイト実験のユースケースでフィーチャーフラグを有効にするには、フィーチャーフラグを参照してください。

ステップ 9: 設定を完了する

すべてのステップを終えたら、[設定を終了] を選択してパートナーページに戻ります。次に、表示されるバナーの指示に従って、Shopify 管理ページで Braze アプリの埋め込みを有効にします。

統合の設定を完了するために、Shopify で Braze アプリの埋め込みを有効にするよう促すバナー。

サンプルコード

shopify-hydrogen-example は、前のステップで説明したすべてのコードを含む Hydrogen アプリの例です。

New Stuff!