コンテンツにスキップ

Shopifyのデータ機能

この記事では、BrazeのShopify機能の概要を説明します。トラッキング対象のShopifyデータやペイロード例、履歴バックフィル、製品の同期について取り上げます。

追跡されるShopifyイベント

Shopifyとの統合では、eコマースの推奨イベントを使用して主要なショッピング行動をキャプチャします。これらのイベントを使用した実装例やマーケティング戦略については、eコマースのユースケースを参照してください。

{
    "name": "ecommerce.product_viewed",
    "properties": {
        "product_id": "12345",
        "product_name": "product",
        "variant_id": "123",
        "image_url": "www.image-url.com",
        "product_url": "mystorefront.myshopify.com/product",
        "price": 10,
        "currency": "USD",
        "source": "mystorefront.myshopify.com",
        "metadata": {
          "sku": "sku"
        },
        "type": [
          "price_drop",
          "back_in_stock"
        ]
    }
}
{
    "name": "ecommerce.cart_updated",
    "properties": {
        "cart_id": "Z2NwLXVzLWVhc3QxOjAxSjk3UFg4RlFZMjVTVkRHRlc1RlI3SlRY",
        "currency": "USD",
        "total_value": 2000000,
        "products": [
            {
                "product_id": "8266836345064",
                "product_name": "PANTS!!!",
                "variant_id": "44610569208040",
                "image_url": "https://cdn.shopify.com/s/files/1/0604/4211/6328/files/1200px-Trousers-colourisolated.jpg?v=1689256168",
                "product_url": "https://test-store.myshopify.com/products/pants?variant=44610569208040",
                "quantity": 2,
                "price": 1000000,
                "metadata": {
                    "sku": "007"
                }
            }
        ],
        "source": "https://test-store.myshopify.com",
        "metadata": {}
    }
}
{
    "name": "ecommerce.checkout_started",
    "time": "2022-05-23T13:52:38-04:00",
    "properties": {
        "cart_id": "eeafa272cebfd4b22385bc4b645e762c",
        "total_value": 421.88,
        "subtotal_value": 396.88,
        "tax": 15.00,
        "shipping": 10.00,
        "currency": "USD",
        "products": [
            {
                "product_id": "632910392",
                "product_name": "IPod Nano - 8GB",
                "variant_id": "808950810",
                "quantity": 1,
                "price": 199,
                "metadata": {
                    "sku": "IPOD2008PINK"
                }
            }
        ],
        "source": "braze-mock-storefront.myshopify.com",
        "checkout_id": "123123123",
        "metadata": {
            "checkout_url": "https://checkout.local/548380009/checkouts/123123123/recover?key=example-secret-token"
        }
    }
}
{
    "name": "ecommerce.order_placed",
    "time": "2022-05-23T13:52:38-04:00",
    "properties": {
        "order_id": "820982911946154508",
        "cart_id": "eeafa272cebfd4b22385bc4b645e762c",
        "total_value": 421.88,
        "subtotal_value": 396.88,
        "tax": 15.00,
        "shipping": 10.00,
        "currency": "USD",
        "total_discounts": 5,
        "discounts": [],
        "products": [
            {
                "product_id": "632910392",
                "product_name": "IPod Nano - 8GB",
                "variant_id": "808950810",
                "quantity": 1,
                "price": 199,
                "metadata": {
                    "sku": "IPOD2008PINK"
                }
            }
        ],
        "source": "braze-mock-storefront.myshopify.com",
        "metadata": {
            "order_status_url": "https://apple.myshopify.com/690933842/orders/123456abcd/authenticate?key=abcdefg",
            "order_number": "1234",
            "tags": [
                "heavy",
                "heavy2"
            ],
            "referring_site": "https://www.google.com",
            "payment_gateway_names": [
                "visa",
                "bogus"
            ]
        }
    }
}
{
 "name": "shopify_fulfilled_order",
 "time": "2022-05-23T14:44:34-04:00",
 "properties": {
   "order_id": 4444668657855,
   "line_items": [
     {
       "quantity": 1,
       "product_id": 6143032066239,
       "sku": null,
       "title": "Dark Denim Top",
  "variant_id": 40094740549876,
       "variant_title": "Small Dark Denim Top",


       "vendor": "partners-demo",
       "name": "Dark Denim Top",
       "properties": [],
       "price": "60.00",
       "fulfillment_status": "fulfilled"
     }
   ],
   "shipping": [
     {
       "title": "Standard",
       "price": "0.00"
     }
   ],
   "total_price": "130.66",
   "confirmed": true,
   "total_discounts": "0.00",
   "discount_codes": [],
   "order_number": 1093,
   "order_status_url": "https://test-store.myshopify.com/",
   "cancelled_at": null,
   "tags": "",
   "closed_at": "2022-05-23T14:44:34-04:00",
   "fulfillment_status": "fulfilled",
   "fulfillments": [
     {
       "shipment_status": null,
       "status": "success",
       "tracking_company": "Other",
       "tracking_number": "456",
       "tracking_numbers": [
         "456"
       ],
       "tracking_url": "https://braze.com",
       "tracking_urls": [
         "https://braze.com"
       ],
       "line_items": [
         {
           "fulfillment_status": "fulfilled",
           "name": "Dark Denim Top",
           "price": "60.00",
           "product_id": 6143032066239,
           "quantity": 1,
           "requires_shipping": true,
           "sku": null,
           "title": "Dark Denim Top",
           "variant_id": 40094740549876,
           "variant_title": "Small Dark Denim Top",
           "vendor": "partners-demo"
         }
       ]
     }
   ]
 },
 "braze_id": "123abc123abc"
}
{
 "name": "shopify_partially_fulfilled_order",
 "time": "2022-05-23T14:43:34-04:00",
 "properties": {
   "order_id": 4444668657855,
   "line_items": [
     {
       "quantity": 1,
       "product_id": 6143032066239,
       "sku": null,
       "title": "Dark Denim Top",
       "variant_id": 40094740549876,
       "variant_title": "",
       "vendor": "partners-demo",
       "name": "Dark Denim Top",
       "properties": [],
       "price": "60.00",
       "fulfillment_status": "fulfilled"
     }
   ],
   "shipping": [
     {
       "title": "Standard",
       "price": "0.00"
     }
   ],
   "total_price": "130.66",
   "confirmed": true,
   "total_discounts": "0.00",
   "discount_codes": [],
   "order_number": 1093,
   "order_status_url": "https://test-store.myshopify.com/",
   "cancelled_at": null,
   "tags": "",
   "closed_at": null,
   "fulfillment_status": "partial",
   "fulfillments": [
     {
       "shipment_status": null,
       "status": "success",
       "tracking_company": "Other",
       "tracking_number": "123",
       "tracking_numbers": [
         "123"
       ],
       "tracking_url": "https://braze.com",
       "tracking_urls": [
         "https://braze.com"
       ],
       "line_items": [
         {
           "fulfillment_status": "fulfilled",
           "name": "Dark Denim Top",
           "price": "60.00",
           "product_id": 6143032066239,
           "properties": [],
           "quantity": 1,
           "requires_shipping": true,
           "sku": null,
           "title": "Dark Denim Top",
           "variant_id": 40094740549876,
           "variant_title": "",
           "vendor": "partners-demo"
         }
       ]
     }
   ]
 },
 "braze_id": "abc123abc123"
}
{
 "name": "shopify_paid_order",
 "time": "2022-05-23T13:52:38-04:00",
 "properties": {
   "order_id": 4444596371647,
   "line_items": [
     {
       "quantity": 1,
       "product_id": 6143033344191,
       "sku": null,
       "title": "LED High Tops",
       "variant_id": 40094740549876,
       "variant_title": null,
       "vendor": "partners-demo",
       "name": "LED High Tops",
       "properties": [],
       "price": "80.00",
       "fulfillment_status": null
     }
   ]
 }
}
{
    "name": "ecommerce.order_cancelled",
    "time": "2022-05-23T13:52:38-04:00",
    "properties": {
        "order_id": "820982911946154508",
        "cancel_reason": "no longer necessary",
        "total_value": 421.88,
        "subtotal_value": 396.88,
        "tax": 15.00,
        "shipping": 10.00,
        "currency": "USD",
        "total_discounts": 5,
        "discounts": [],
        "products": [
            {
                "product_id": "632910392",
                "product_name": "IPod Nano - 8GB",
                "variant_id": "808950810",
                "quantity": 1,
                "price": 199,
                "metadata": {
                    "sku": "IPOD2008PINK"
                }
            }
        ],
        "source": "braze-mock-storefront.myshopify.com",
        "metadata": {
            "order_status_url": "https://apple.myshopify.com/690933842/orders/123456abcd/authenticate?key=abcdefg",
            "order_number": "1234",
            "tags": [
                "heavy",
                "heavy2"
            ]
        }
    }
}
{
    "name": "ecommerce.order_refunded",
    "time": "2022-05-23T13:52:38-04:00",
    "properties": {
        "order_id": "820982911946154508",
        "total_value": 421.88,
        "currency": "USD",
        "products": [
            {
                "product_id": "632910392",
                "product_name": "IPod Nano - 8GB",
                "variant_id": "808950810",
                "quantity": 1,
                "price": 199,
                "metadata": {
                    "sku": "IPOD2008PINK"
                }
            }
        ],
        "source": "braze-mock-storefront.myshopify.com",
        "metadata": {
		"order_note": "item was broken"
        }
    }
}
{
	"name": "shopify_account_login",
	"properties": {
	"source": "braze-mock-storefront.myshopify.com"
  }
}

イベント: ecommerce.product_viewed
タイプ: 推奨イベント
トリガー: 顧客が商品ページを閲覧したとき
データソース: Braze SDK
ユースケース: 閲覧放棄

変数 Liquidテンプレート
product_id {{event_properties.${product_id}}}
product_name {{event_properties.${product_name}}}
variant_id {{event_properties.${variant_id}}}
image_url {{event_properties.${image_url}}}
product_url <your-store.myshopify.com>{{event_properties.${product_url}}}

URLの前にShopifyサイトのドメインを追加してください。
price {{event_properties.${price}}}
currency {{event_properties.${currency}}}
source {{event_properties.${source}}}
sku {{event_properties.${metadata}[0].sku}}
type event_properties.${type}

イベント: ecommerce.cart_updated
タイプ: 推奨イベント
トリガー: 顧客がショッピングカートに商品を追加、削除、または更新したとき
データソース: Braze SDK
ユースケース: カート放棄

カート放棄キャンバスでは、まず最初のショッピングカートLiquidタグを追加して、メッセージ内でショッピングカートのコンテキストを取得する必要があります。

{% shopping_cart {{context.${cart_id}}} %}

その後、次のショッピングカートLiquidタグをメッセージに追加できます。

変数 Liquidテンプレート
cart_id {{ shopping_cart.cart_id }}
currency {{ shopping_cart.currency }}
total_value {{ shopping_cart.total_value }}
product_id {{ shopping_cart.products[0].product_id }}
product_name {{ shopping_cart.products[0].product_name }}
variant_id {{ shopping_cart.products[0].variant_id }}
image_url {{ shopping_cart.products[0].image_url }}
product_url {{ shopping_cart.products[0].product_url }}
quantity {{ shopping_cart.products[0].quantity }}
price {{ shopping_cart.products[0].price }}
sku {{ shopping_cart.products[0].metadata[0].sku }}
source {{ shopping_cart.source }}
metadata (value) {{ shopping_cart.metadata[0].<add_value_here> }}

イベント: ecommerce.checkout_started
タイプ: 推奨イベント
トリガー: ユーザーがチェックアウトページに移動したとき
データソース: Braze REST API
ユースケース: チェックアウト放棄

チェックアウト放棄キャンバスでは、まず次のLiquidタグを使用する必要があります。

{% shopping_cart {{context.${cart_id}}} :abort_if_not_abandoned false %}
{{context.${cart_id}}}

その後、次のLiquidタグをメッセージに追加すると、チェックアウト時点でカート内にある商品を参照できます。

変数 Liquidテンプレート
cart_id {{ shopping_cart.cart_id }}
currency {{ shopping_cart.currency }}
total_value {{ shopping_cart.total_value }}
product_id {{ shopping_cart.products[0].product_id }}
product_name {{ shopping_cart.products[0].product_name }}
variant_id {{ shopping_cart.products[0].variant_id }}
image_url {{ shopping_cart.products[0].image_url }}
product_url {{ shopping_cart.products[0].product_url }}
quantity {{ shopping_cart.products[0].quantity }}
price {{ shopping_cart.products[0].price }}
sku {{ shopping_cart.products[0].metadata.sku }}
source {{ shopping_cart.source }}
checkout_url {{ shopping_cart.metadata[0].checkout_url }}

イベント: ecommerce.order_placed
タイプ: 推奨イベント
トリガー: ユーザーがチェックアウトプロセスを正常に完了し、注文を確定したとき
データソース: Braze REST API
ユースケース: 注文確認、購入後のリターゲティング、アップセルまたはクロスセル

別のシステムがすでに注文確定イベントをBrazeに送信している場合は、「Shopifyデータの追跡」ステップで Send Order Placed events from another source を使用して、ストアごとにこのイベントをオフにできます。その場合、Brazeはそのストアのリアルタイム注文およびバックフィルされた注文について ecommerce.order_placed をスキップしますが、他の注文イベント、shopify_paid_order、および購入属性は引き続き更新されます。詳細については、標準データ設定を参照してください。

変数 Liquidテンプレート
cart_id {{event_properties.${cart_id}}}
currency {{event_properties.${currency}}}
discounts {{event_properties.${discounts}}}
order_id {{event_properties.${order_id}}}
product_id {{event_properties.${products}[0].product_id}}
product_name {{event_properties.${products}[0].product_name}}
variant_id {{event_properties.${products}[0].variant_id}}
quantity {{event_properties.${products}[0].quantity}}
sku {{event_properties.${products}[0].metadata.sku}}
total_discounts {{event_properties.${total_discounts}}}
order_status_url {{event_properties.${metadata}.order_status_url}}
order_number {{event_properties.${metadata}.order_number}}
tags {{event_properties.${metadata}.tags}}
referring_site {{event_properties.${metadata}.referring_site}}
payment_gateway_names {{event_properties.${metadata}.payment_gateway_names}}

イベント: shopify_fulfilled_order
タイプ: カスタムイベント
トリガー: ユーザーの注文がフルフィルメント済みとなり、発送準備が整ったとき
データソース: Braze REST API
ユースケース: (トランザクション)フルフィルメントの更新

変数 Liquidテンプレート
注文ID {{event_properties.${order_id}}}
合計金額 {{event_properties.${total_price}}}
合計割引額 {{event_properties.${total_discounts}}}
確認ステータス {{event_properties.${confirmed}}}
注文ステータスURL {{event_properties.${order_status_url}}}
注文番号 {{event_properties.${order_number}}}
キャンセルのタイムスタンプ {{event_properties.${cancelled_at}}}
クローズのタイムスタンプ {{event_properties.${closed_at}}}
商品ID {{event_properties.${line_items}[0].product_id}}
商品数量 {{event_properties.${line_items}[0].quantity}}
商品SKU {{event_properties.${line_items}[0].sku}}
商品タイトル {{event_properties.${line_items}[0].title}}
商品ベンダー {{event_properties.${line_items}[0].vendor}}
商品名 {{event_properties.${line_items}[0].name}}
商品プロパティ {{event_properties.${line_items}[0].properties}}
商品価格 {{event_properties.${line_items}[0].price}}
配送タイトル {{event_properties.${shipping}[0].title}}
配送料金 {{event_properties.${shipping}[0].price}}
フルフィルメントステータス {{event_properties.${fulfillment_status}}}
フルフィルメント配送ステータス {{event_properties.${fulfillments}[0].shipment_status}}
ステータス {{event_properties.${fulfillments}[0].status}}
フルフィルメント配送業者 {{event_properties.${fulfillments}[0].Fulfillment tracking_company}}
フルフィルメント追跡番号 {{event_properties.${fulfillments}[0].Fulfillment tracking_number}}
フルフィルメント追跡番号(複数) {{event_properties.${fulfillments}[0].Fulfillment tracking_numbers}}
フルフィルメント追跡URL {{event_properties.${fulfillments}[0].Fulfillment tracking_url}}
フルフィルメント追跡URL(複数) {{event_properties.${fulfillments}[0].Fulfillment tracking_urls}}
フルフィルメントステータス {{event_properties.${fulfillments}[0].line_items[0].fulfillment_status}}
フルフィルメント名 {{event_properties.${fulfillments}[0].line_items[0].name}}
フルフィルメント価格 {{event_properties.${fulfillments}[0].line_items[0].price}}
フルフィルメント商品ID {{event_properties.${fulfillments}[0].line_items[0].product_id}}
フルフィルメント数量 {{event_properties.${fulfillments}[0].line_items[0].quantity}}
フルフィルメント配送要否 {{event_properties.${fulfillments}[0].line_items[0].requires_shipping}}
フルフィルメントSKU {{event_properties.${fulfillments}[0].line_items[0].sku}}
フルフィルメントタイトル {{event_properties.${fulfillments}[0].line_items[0].title}}
フルフィルメントベンダー {{event_properties.${fulfillments}[0].line_items[0].vendor}}
バリアントID {{event_properties.${line_items}[0].variant_id}}
バリアントタイトル {{event_properties.${line_items}[0].variant_title}}

イベント: shopify_partially_fulfilled_order
タイプ: カスタムイベント
トリガー: ユーザーの注文の一部がフルフィルメント済みとなり、発送準備が整ったとき
データソース: Braze REST API
ユースケース: (トランザクション)フルフィルメントの更新

変数 Liquidテンプレート
注文ID {{event_properties.${order_id}}}
合計金額 {{event_properties.${total_price}}}
合計割引額 {{event_properties.${total_discounts}}}
確認ステータス {{event_properties.${confirmed}}}
注文ステータスURL {{event_properties.${order_status_url}}}
注文番号 {{event_properties.${order_number}}}
キャンセルのタイムスタンプ {{event_properties.${cancelled_at}}}
クローズのタイムスタンプ {{event_properties.${closed_at}}}
商品ID {{event_properties.${line_items}[0].product_id}}
商品数量 {{event_properties.${line_items}[0].quantity}}
商品SKU {{event_properties.${line_items}[0].sku}}
商品タイトル {{event_properties.${line_items}[0].title}}
商品ベンダー {{event_properties.${line_items}[0].vendor}}
商品名 {{event_properties.${line_items}[0].name}}
商品プロパティ {{event_properties.${line_items}[0].properties}}
商品価格 {{event_properties.${line_items}[0].price}}
配送タイトル {{event_properties.${shipping}[0].title}}
配送料金 {{event_properties.${shipping}[0].price}}
フルフィルメントステータス {{event_properties.${fulfillment_status}}}
フルフィルメント配送ステータス {{event_properties.${fulfillments}[0].shipment_status}}
フルフィルメントステータス {{event_properties.${fulfillments}[0].status}}
フルフィルメント配送業者 {{event_properties.${fulfillments}[0].tracking_company}}
フルフィルメント追跡番号 {{event_properties.${fulfillments}[0].tracking_number}}
フルフィルメント追跡番号(複数) {{event_properties.${fulfillments}[0].tracking_numbers}}
フルフィルメント追跡URL {{event_properties.${fulfillments}[0].tracking_url}}
フルフィルメント追跡URL(複数) {{event_properties.${fulfillments}[0].tracking_urls}}
フルフィルメントステータス {{event_properties.${fulfillments}[0].line_items[0].fulfillment_status}}
フルフィルメント名 {{event_properties.${fulfillments}[0].line_items[0].name}}
フルフィルメント価格 {{event_properties.${fulfillments}[0].line_items[0].price}}
フルフィルメント商品ID {{event_properties.${fulfillments}[0].line_items[0].product_id}}
フルフィルメント数量 {{event_properties.${fulfillments}[0].line_items[0].quantity}}
フルフィルメント配送要否 {{event_properties.${fulfillments}[0].line_items[0].requires_shipping}}
フルフィルメントSKU {{event_properties.${fulfillments}[0].line_items[0].sku}}
フルフィルメントタイトル {{event_properties.${fulfillments}[0].line_items[0].title}}
フルフィルメントベンダー {{event_properties.${fulfillments}[0].line_items[0].vendor}}
バリアントID {{event_properties.${line_items}[0].variant_id}}
バリアントタイトル {{event_properties.${line_items}[0].variant_title}}

イベント: shopify_paid_order
タイプ: カスタムイベント
トリガー: ユーザーの注文がShopify内で支払い済みとしてマークされたとき
データソース: Braze REST API
ユースケース: (トランザクション)支払い確認

変数 Liquidテンプレート
注文ID {{event_properties.${order_id}}}
確認ステータス {{event_properties.${confirmed}}}
注文ステータスURL {{event_properties.${order_status_url}}}
注文番号 {{event_properties.${order_number}}}
キャンセルのタイムスタンプ {{event_properties.${cancelled_at}}}
合計割引額 {{event_properties.${total_discounts}}}
合計金額 {{event_properties.${total_price}}}
タグ {{event_properties.${tags}}}
割引コード {{event_properties.${discount_codes}}}
商品ID {{event_properties.${line_items}[0].product_id}}
商品数量 {{event_properties.${line_items}[0].quantity}}
商品SKU {{event_properties.${line_items}[0].sku}}
商品タイトル {{event_properties.${line_items}[0].title}}
商品ベンダー {{event_properties.${line_items}[0].vendor}}
商品プロパティ {{event_properties.${line_items}[0].properties}}
商品価格 {{event_properties.${line_items}[0].price}}
配送タイトル {{event_properties.${shipping}[0].title}}
配送料金 {{event_properties.${shipping}[0].price}}
バリアントID {{event_properties.${line_items}[0].variant_id}}
バリアントタイトル {{event_properties.${line_items}[0].variant_title}}

イベント: ecommerce.order_cancelled
タイプ: 推奨イベント
トリガー: ユーザーの注文がキャンセルされたとき
データソース: Braze REST API
ユースケース: (トランザクション)注文キャンセルの確認

変数 Liquidテンプレート
注文ID {{event_properties.${order_id}}}
合計金額 {{event_properties.${total_price}}}
合計割引額 {{event_properties.${total_discounts}}}
確認済み {{event_properties.${confirmed}}}
注文ステータスURL {{event_properties.${order_status_url}}}
注文番号 {{event_properties.${order_number}}}
キャンセルのタイムスタンプ {{event_properties.${cancelled_at}}}
タグ {{event_properties.${tags}}}
割引コード {{event_properties.${discount_codes}}}
フルフィルメントステータス {{event_properties.${fulfillment_status}}}
フルフィルメント {{event_properties.${fulfillments}}}
商品ID {{event_properties.${line_items}[0].product_id}}
商品数量 {{event_properties.${line_items}[0].quantity}}
商品SKU {{event_properties.${line_items}[0].sku}}
商品タイトル {{event_properties.${line_items}[0].title}}
商品ベンダー {{event_properties.${line_items}[0].vendor}}
商品名 {{event_properties.${line_items}[0].name}}
商品プロパティ {{event_properties.${line_items}[0].properties}}
フルフィルメントステータス {{event_properties.${line_items}[0].fulfillment_status}}
配送タイトル {{event_properties.${shipping}[0].title}}
配送料金 {{event_properties.${shipping}[0].price}}
バリアントID {{event_properties.${line_items}[0].variant_id}}
バリアントタイトル {{event_properties.${line_items}[0].variant_title}}

イベント: ecommerce.order_refunded
タイプ: 推奨イベント
トリガー: ユーザーの注文が返金されたとき
データソース: Braze REST API
ユースケース: (トランザクション)返金確認

変数 Liquidテンプレート
注文ID {{event_properties.${order_id}}}
注文メモ {event_properties.${note}}}
商品ID {{event_properties.${line_items}[0].product_id}}
商品数量 {{event_properties.${line_items}[0].quantity}}
商品SKU {{event_properties.${line_items}[0].sku}}
商品タイトル {{event_properties.${line_items}[0].title}}
商品ベンダー {{event_properties.${line_items}[0].vendor}}
商品名 {{event_properties.${line_items}[0].name}}
商品プロパティ {{event_properties.${line_items}[0].properties}}
商品価格 {{event_properties.${line_items}[0].price}}
バリアントID {{event_properties.${line_items}[0].variant_id}}
バリアントタイトル {{event_properties.${line_items}[0].variant_title}}

イベント: shopify_account_login
タイプ: カスタムイベント
トリガー: ユーザーが自分のアカウントにログインしたとき
データソース: Braze REST API
ユースケース: ウェルカムシリーズ

変数 Liquidテンプレート
source {{event_properties.${source}}}

サポートされているShopifyカスタム属性

{
  "attributes": [
    {
      "shopify_tags": "VIP_customer",
      "shopify_total_spent": "60.00",
      "shopify_orders_count": "3",
      "shopify_last_order_id": "1234567",
      "shopify_zipcode": "10001",
      "shopify_province": "null"
    }
  ]
}
属性名 説明 データソース
shopify_total_spent 顧客が注文履歴全体で使用した合計金額。 Shopifyの customers/purchasing_summary Webhook
shopify_orders_count この顧客に関連付けられた注文の数。テスト注文とアーカイブ済みの注文はカウントされません。 Shopifyの customers/purchasing_summary Webhook
shopify_last_order_id 顧客の最後の注文のID。 Shopifyの customers/purchasing_summary Webhook
shopify_zipcode 顧客のデフォルト住所の郵便番号。 Shopifyの customers/create および customers/update Webhook
shopify_province 顧客のデフォルト住所の州。 Shopifyの customers/create および customers/update Webhook
shopify_locale 顧客のロケール (en や fr-CA など)。注文するまではBraze Webピクセルが収集したブラウザー言語から設定され、その後は最新のチェックアウトのロケールから更新されます。 Braze Webピクセル、Shopify orders/* Webhook、過去の顧客データのバックフィル

Liquidパーソナライゼーション

ShopifyカスタムしたLiquidパーソナライゼーションを追加するには、+ パーソナライゼーションを選択します。次に、パーソナライゼーションタイプとしてカスタム属性を選択します。

「属性」ドロップダウンが展開された「パーソナライゼーションを追加」セクション。

カスタム属性を選択したら、デフォルト値を入力し、Liquidスニペットをコピーしてメッセージに貼り付けます。

メッセージにLiquidスニペットを貼り付けている様子。

サポートされている Shopify 標準属性項目

  • メール
  • 名
  • 姓
  • 電話番号
  • 市区町村
  • 国

Shopify 顧客メタフィールド

Shopify 顧客メタフィールドには、ロイヤルティティアや解約リスクスコアなど、顧客に関する独自のデータを保持できます。標準統合を使用すると、最大20個の顧客メタフィールド定義を Braze のユーザープロファイルに同期し、セグメンテーションやパーソナライゼーションに活用できます。

メタフィールドがユーザープロファイルに保存される仕組み

Braze は、接続されたストアごとに shopify_metafields_<store> という名前の階層化カスタム属性を1つ追加します。<store> は <store>.myshopify.com ドメインの最初の部分です。選択した各メタフィールドは、このオブジェクト内の <namespace>_<key> という名前のキーになります。たとえば、ストア acme.myshopify.com の定義 custom.vip_tier と custom.loyalty_points は、プロファイルに次のように保存されます。

{
  "shopify_metafields_acme": {
    "custom_vip_tier": "gold",
    "custom_loyalty_points": 120
  }
}

各更新はオブジェクトにディープマージされるため、1つのキーのみを含む更新で他のキーが消去されることはなく、Braze がオブジェクトからキーを削除することもありません。Shopify でメタフィールドが空の場合、プロファイルには最後の値が保持されます。

サポートされているメタフィールドタイプ

ピッカーには、次のタイプの定義のみが表示されます。参照、ファイル、JSON、金額、評価などのその他のタイプはサポートされていません。

Shopify のタイプ プロファイルでの保存形式
単一行テキスト、複数行テキスト、色、URL、ID 文字列
整数 整数
小数 数値
真または偽 ブール値
日付、日時 時間 (日付ベースのセグメントフィルターを使用できます)
単一行テキスト、日付、日時、色、ID、または URL のリスト 文字列の配列

次の場合、Braze はその値をプロファイルに書き込まず、他のキーの書き込みを続行します。

  • 文字列値、またはリスト内の項目が255文字を超える場合。
  • 値を定義のタイプに変換できない場合 (整数フィールド内のテキストなど)。
  • 属性キー (<namespace>_<key>) が255文字を超える場合、または $ や . など Braze が保存できない文字が含まれている場合。

値が同期されるタイミング

ソース タイミング
Shopify の customers/create および customers/update Webhook Shopify で顧客が変更されたとき (選択したメタフィールドの変更を含む)
履歴バックフィル 設定時にメタフィールドを選択した場合、最初の顧客バックフィルにそれらが含まれます
既存の顧客 接続済みのストアにメタフィールドを追加すると、Braze は、履歴顧客バックフィル期間の開始以降 (バックフィルがオフだった場合はストアの接続以降) に更新された顧客のユーザープロファイルに、それらの値を同期します。この処理の実行中、統合ページには 既存のユーザープロファイルに顧客メタフィールドを同期中 と表示され、完了するまでピッカーは使用できません。

同期の状態は、統合ページの Shopify ユーザー属性テーブルで確認できます。このテーブルには、デフォルト属性と顧客メタフィールドが、ステータス (アクティブ、または同期の実行中は更新中) と各属性の数とともに一覧表示されます。行の表示アイコンを選択すると、属性名を確認できます。

メタフィールドの変更または削除

  • 選択内容を変更するには、統合ページで設定を編集を選択し、Shopify データのトラッキングステップでピッカーを更新します。メタフィールドを追加すると既存の顧客の同期が開始され、削除するとそのキーの更新が停止します。
  • 選択からメタフィールドを削除した場合、または顧客メタフィールドをユーザー属性として同期をオフにした場合、ユーザープロファイルには Shopify からの最後の値が保持され、更新は停止します。
  • Shopify で定義を削除すると、Braze は自動的にその定義を選択から削除します。ユーザープロファイルにすでに保存されている値はそのまま残ります。

セグメンテーションとパーソナライゼーション

メタフィールドでフィルタリングする前に、属性のスキーマを生成する必要があります。データ設定 > カスタム属性に移動し、shopify_metafields_<store> を見つけてスキーマを生成を選択します。Braze はユーザープロファイルにすでに保存されている値からスキーマを構築するため、最初の同期が完了した後に実行し、メタフィールドを追加した後は新しいキーが表示されるようにスキーマを再生成してください。

メタフィールドでセグメンテーションするには、階層化カスタム属性フィルターを追加し、shopify_metafields_<store> を選択して、プロパティとしてキーを選択してから、そのタイプに応じた比較演算子を選択します。日付メタフィールドでは、時間および年間通算日の比較演算子を使用します。メッセージをパーソナライズするには、ドット表記で custom_attribute タグを使用します。前述の例のプロファイルでは、{{custom_attribute.${shopify_metafields_acme}.custom_vip_tier}} は gold を返します。

Connected Audience API 呼び出しでは階層化カスタム属性をフィルターとして使用できません。また、カスタムユーザーとしてプレビューでは、モックデータは文字列または文字列の配列としてのみ受け付けられます。全リストについては、階層化カスタム属性に関する考慮事項を参照してください。

SDKのデータ収集

Braze SDKが収集するデータの詳細については、SDKのデータ収集を参照してください。

履歴バックフィル

Shopify の履歴データは、Braze を接続する前の期間からインポートされます。設定時に、注文イベントと顧客プロファイルをどこまで遡ってインポートするかを選択します。各期間は、統合を完了した日付から遡って計算されます。

Shopify 標準統合の設定または Shopify カスタム統合の設定で履歴バックフィルをオンにすると、過去の顧客と注文をセグメント、キャンペーン、キャンバスに含めることができます。オンにする場合は、以下を選択します。

  • 注文の期間:過去90日間、過去1年間、または過去2年間(デフォルトは過去90日間)
  • 顧客プロファイルの期間:過去1年間、過去2年間、または全期間(デフォルトは全期間)

設定を完了する前に、Braze は各オプションの推定レコード数と処理時間を表示します。バックフィルが完了すると、選択した期間が Shopify パートナーページに具体的な日付として表示されます。これらの選択は、設定完了後に変更できません。

Braze が Shopify の顧客をインポートする際は、設定で選択した external_id タイプが割り当てられます。

カスタムexternal IDを使用して統合する予定の場合(標準統合またはカスタム統合のいずれか)、カスタムexternal IDをShopify顧客メタフィールドとして既存のすべてのShopify顧客プロファイルに追加し、その後に履歴バックフィルを実行する必要があります。

Braze による履歴データの選択方法

初回読み込みの実行時に、Braze は以下の Shopify 日付フィールドを使用します。

データ 選択可能な期間 Shopify 日付フィールド
注文イベント(注文完了、注文返金、注文キャンセル) 過去90日間、過去1年間、または過去2年間 注文作成日
ユーザープロファイル 過去1年間、過去2年間、または全期間 顧客更新日

過去の注文を元の作成日を保持したまま Shopify に移行した場合、Braze は作成日が選択した注文期間内に収まる注文のみをインポートします。

Shopify 履歴バックフィルの設定

  1. Shopify データを追跡ステップで履歴バックフィルをオンにするを選択します。
  2. 注文の期間と顧客プロファイルの期間を選択します。選択内容の推定件数と処理時間を確認します。
  3. 統合の設定を完了すると、Braze は初回データ同期を開始します。進捗状況は、統合設定の Shopify データタブで確認できます。

イベントが同期中であることを示すスピナーが表示された Shopify 統合設定ページ。

バックフィルの同期レートとタイミング

履歴バックフィルは Braze SDK ではなく Braze の Shopify 統合によって実行され、統合の設定を完了すると自動的に開始されます。

履歴バックフィルを有効にすると、Braze は Shopify から注文イベントと顧客プロファイルをバッチでインポートします。注文イベントと顧客プロファイルは別々のタイムラインで同期されるため、一方が先に完了する場合があります。大規模なバックフィルは、同時に実行できるよう並列の期間に分割されます。

同期時間は、ストア内の履歴データの量と選択した期間によって異なります。注文量が多いストアや顧客基盤が大きいストアでは、バックフィルの完了に時間がかかる場合があります。バックフィルの速度を変更したり、より高速な同期をリクエストしたりすることはできません。

同期されるデータ

初回データ同期では、Braze は Braze による履歴データの選択方法で説明されている注文イベントとユーザープロファイルをインポートします。Braze が Shopify の顧客をインポートする際は、設定で選択した external_id タイプが割り当てられます。設定時に顧客メタフィールドを選択した場合は、顧客のバックフィルでそれらの値も書き込まれます。

次の表は、初回読み込みに含まれるデータをまとめたものです。

Braze 推奨イベント Shopify カスタムイベント Braze 標準属性 Braze 購読ステータス
  • 注文完了
  • 注文キャンセル
  • 注文返金
  • shopify_tags
  • shopify_total_spent
  • shopify_orders_count
  • shopify_last_order_id
  • shopify_zipcode
  • shopify_province
  • shopify_locale
  • メール
  • 名
  • 姓
  • 電話番号
  • 市区町村
  • 国
  • 総収益
  • 総返金額
  • 総注文数
  • この Shopify ストアに関連付けられたメールマーケティングの購読
  • この Shopify ストアに関連付けられた SMS マーケティングの購読
New Stuff!