Adobe Experience Platform Mobile SDKとCommerceの統合
Adobe Experience Platform モバイル SDKをCommerce モバイルアプリと統合すると、マーチャントはCommerce イベントデータ をExperience Platform エッジに送信できます。
Commerce イベントデータがエッジで利用可能な場合、他のAdobe Experience Cloud アプリケーションからアクセスできます。 例えば、データを使用してReal-Time CDPでオーディエンスを作成し、それらのオーディエンス を使用してCommerce モバイルアプリをパーソナライズできます。
設定
Adobe Experience Platform Mobile SDKとCommerceの使用を開始するには、Experience PlatformにSDKをインストールして設定します。 次に、Commerceで設定を確定します。
Experience Platform
-
モバイルアプリの機能について詳しくは、 モバイルアプリのAdobe Experience Cloud チュートリアル を参照してください。
-
Experience PlatformにSDKをインストールして設定します。
note NOTE Experience Platformで作成および設定するスキーマは、Commerce モバイルアプリのアプリケーションコードで使用するスキーマと同じです。
Commerce
Experience PlatformのSDK設定を完了したら、SDK設定をCommerceに追加します。
-
Commerce イベントデータをSDK経由でExperience Platformに送信するには、アプリケーションコードにXDM スキーマを指定する必要があります。 このスキーマは、Experience PlatformのSDKのスキーマ configuredと一致する必要があります。
次の例は、
web.webpagedetails.pageViewsイベントを追跡し、電子メールフィールドを使用してidentityMapを設定する方法を示しています。code language-swift let stateName = "luma: content: ios: us: en: home" var xdmData: [String: Any] = [ "eventType": "web.webpagedetails.pageViews", "web": [ "webPageDetails": [ "pageViews": [ "value": 1 ], "name": "Home page" ] ] ] let experienceEvent = ExperienceEvent(xdm: xdmData) Edge.sendEvent(experienceEvent: experienceEvent) // Adobe Experience Platform - Update Identity let emailLabel = "mobileuser@example.com" let identityMap: IdentityMap = IdentityMap() identityMap.add(item: IdentityItem(id: emailLabel), withNamespace: "Email") Identity.updateIdentities(with: identityMap) -
Commerce Cloudとの連携。
プロジェクトのビルド設定で、Commerce GraphQL エンドポイントにURLを追加します。 例:
- デバッグ:http://debug.commercesite.cloud/graphql/
- リリース:http://release.commercesite.cloud/graphql/
-
Commerce GraphQL エンドポイントからデータを取得するには、まずApollo Code Generatorを使用して、プロジェクトに必要なファイルとディレクトリを生成します。
-
プロジェクト ディレクトリから、install Apollo iOSをインストールします。
-
Apollo Codegen CLIを初期化。
これで
apollo-codegen-configuration.jsonファイルが作成されます。 -
apollo-codegen-configuration.jsonファイルの内容を次の内容に置き換えて、プロジェクトに必要なGraphQL ファイルとディレクトリを生成します。code language-json { "schemaName" : "MagentoAPI", "input" : { "operationSearchPaths" : [ "**/*.graphql" ], "schemaSearchPaths" : [ "**/*.graphqls" ] }, "output" : { "testMocks" : { "none" : { } }, "schemaTypes" : { "path" : "../MagentoAPI", "moduleType" : { "swiftPackageManager" : { } } }, "operations" : { "inSchemaModule" : { } } }, "schemaDownloadConfiguration": { "downloadMethod": { "introspection": { "endpointURL": "http://magento24.com/graphql/", "httpMethod": { "POST": {} }, "includeDeprecatedInputValues": false, "outputFormat": "SDL" } }, "downloadTimeout": 60, "headers": [], "outputPath": "magento.graphqls" } } -
Commerce GraphQL スキーマを取得します。
Commerce GraphQL スキーマへの参照を含む
./apollo-codegen-config.jsonファイルへのパスであることを確認します。 -
ソースコードを生成します。
必要なファイルとディレクトリを生成するための構成情報を含む
./apollo-codegen-config.jsonファイルへのパスであることを確認します。 -
新しく作成したGraphQLGenerated フォルダー内で、GraphQL タイプを追加または編集します。 例えば、次の内容を含む
DynamicBlocks.graphqlタイプを追加できます。code language-graphql query dynamicBlocks($input: DynamicBlocksFilterInput){ dynamicBlocks(input: $input) { items { content { html } } } }
これで、Adobe Experience Platform Mobile SDKとCommerce モバイルアプリを統合しました。 アプリからExperience Platform edgeへのイベントデータフロー。
-
モバイルアプリケーションから生成されたCommerce イベントの識別方法
すべての イベント には、channelというフィールドが含まれています。 channel フィールドには、channel._idとchannel._typeが含まれており、Luma ストアフロントの名前空間値はそれぞれ"https://ns.adobe.com/xdm/channels/web"と"https://ns.adobe.com/xdm/channel-types/web"です。 ただし、モバイルストアフロントの場合、名前空間の値はそれぞれ"https://ns.adobe.com/xdm/channels/mobile-app"と"https://ns.adobe.com/xdm/channel-types/mobile"です。
次のステップ
モバイル Commerce アプリからReal-Time CDP オーディエンスを取得し、カートの価格ルール、動的ブロック、および関連する商品ルールを通知する方法については、Audience Activationを参照してください。