使用自定义操作在 Experience Platform 中写入历程事件 custom-action-aep

在此页面上:​了解如何使用自定义操作和经过身份验证的API调用,将自定义历程事件从历程写入Adobe Experience Platform。

此用例说明了如何使用自定义操作和经过身份验证的调用,将自定义事件从历程写入Adobe Experience Platform。

配置开发人员项目 custom-action-aep-IO

  1. 在Adobe Developer Console中,单击​ 项目 ​并打开您的IO项目。

  2. 在​ 凭据 ​部分中,单击​OAuth服务器到服务器。

    带有操作类型下拉列表的自定义操作配置屏幕

  3. 单击​查看cURL命令。

    Adobe Experience Platform操作类型选择

  4. 复制cURL命令并存储client_id、client_secret、grant_type和scope。

curl -X POST 'https://ims-na1.adobelogin.com/ims/token/v3' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=client_credentials&client_id=1234&client_secret=5678&scope=openid,AdobeID,read_organizations,additional_info.projectedProductContext,session'
CAUTION
在Adobe Developer Console上创建项目后,请确保向开发人员和API授予具有正确权限的访问控制。 请参阅Adobe Experience Platform 文档以了解详情

使用HTTP API入口配置源

  1. 在Adobe Experience Platform中创建端点以写入历程中的数据。

  2. 在Adobe Experience Platform中,单击左侧菜单中的​ 连接 ​下的​源。 在​ HTTP API ​下,单击​添加数据。

    Adobe Experience Platform 🔗 的沙盒选择下拉列表

  3. 选择​ 新帐户 ​并启用身份验证。 选择​连接到Source。

    流数据的 数据集选择界面

  4. 选择​ 下一步 ​以及要写入数据的数据集。 单击​ 下一步 ​和​完成。

    映射到操作参数的XDM架构字段

  5. 打开新创建的数据流。 复制架构有效负载并将其保存在记事本中。

{
"header": {
"schemaRef": {
"id": "https://ns.adobe.com/<your_org>/schemas/<schema_id>",
"contentType": "application/vnd.adobe.xed-full+json;version=1.0"
},
"imsOrgId": "<org_id>",
"datasetId": "<dataset_id>",
"source": {
"name": "Custom Journey Events"
}
},
"body": {
"xdmMeta": {
"schemaRef": {
"id": "https://ns.adobe.com/<your_org>/schemas/<schema_id>",
"contentType": "application/vnd.adobe.xed-full+json;version=1.0"
}
},
"xdmEntity": {
"_id": "test1",
"<your_org>": {
"journeyVersionId": "",
"nodeId": "", "customer_Id":""
},
"eventMergeId": "",
"eventType": "",
"producedBy": "self",
"timestamp": "2018-11-12T20:20:39+00:00"
}
}
}

配置自定义操作 custom-action-config

自定义操作配置在此页面中有详细说明。

对于此示例,请按照以下步骤操作:

  1. 打开Adobe Journey Optimizer,然后单击左侧菜单中​ 管理 ​下的​配置。 在​ 操作 ​下,单击​管理,然后单击​创建操作。

  2. 设置URL并选择Post方法。

    https://dcs.adobedc.net/collection/<collection_id>?syncValidation=false

  3. 确保配置标头(Content-Type、Charset、sandbox-name)。

    历程画布中的自定义操作(带有配置窗格)

设置身份验证 custom-action-aep-authentication

  1. 使用以下有效负载选择​ Type ​作为​Custom。

  2. 粘贴client_secret、client_id、scope和grant_type(来自以前使用的IO项目有效负载)。

    code language-none
    {
    "type": "customAuthorization",
    "authorizationType": "Bearer",
    "endpoint": "https://ims-na1.adobelogin.com/ims/token/v3",
    "method": "POST",
    "headers": {},
    "body": {
    "bodyType": "form",
    "bodyParams": {
    "grant_type": "client_credentials",
    "client_secret": "********",
    "client_id": "<client_id>",
    "scope": "openid,AdobeID,read_organizations,additional_info.projectedProductContext,session"
    }
    },
    "tokenInResponse": "json://access_token",
    "cacheDuration": {
    "duration": 28000,
    "timeUnit": "seconds"
    }
    }
    
  3. 使用​ 单击测试身份验证 ​按钮测试连接。

    带有表达式编辑器的参数映射接口

设置有效负载 custom-action-aep-payload

  1. 在​ 请求 ​和​ 响应 ​字段中,粘贴以前使用的源连接中的有效负载。

    code language-none
    {
    "xdmMeta": {
    "schemaRef": {
    "id": "https://ns.adobe.com/<your_org>/schemas/<schema_id>",
    "contentType": "application/vnd.adobe.xed-full+json;version=1.0"
    }
    },
    "xdmEntity": {
    "_id": "/uri-reference",
    "<your_org>": {
    "journeyVersionId": "Sample value",
    "nodeId": "Sample value",
    "customer_Id":""
    },
    "eventMergeId": "Sample value",
    "eventType": "advertising.completes,
    "producedBy": "self",
    "timestamp": "2018-11-12T20:20:39+00:00"
    }
    }
    
  2. 将动态填充的字段的字段配置从​ 常量 ​更改为​变量。

  3. 保存自定义操作。

历程

  1. 最后,在历程中使用此自定义操作编写自定义历程事件。

  2. 根据您的用例填充历程版本ID、节点ID、节点名称和其他属性。

    复杂字段映射的 高级模式编辑器

AI Knowledge Reference

This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.

For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.

  • TL;DR: This use case explains how to configure a custom action in Journey Optimizer that writes journey event data into Adobe Experience Platform using an HTTP API inlet and OAuth Server-to-Server authenticated calls.

Intents:

  • Set up an Adobe Developer Console IO project with OAuth Server-to-Server credentials for AEP API authentication
  • Create an HTTP API inlet source in Adobe Experience Platform to receive streaming journey event data
  • Configure a custom action in Journey Optimizer with the correct URL, headers, and custom Bearer token authentication
  • Map journey fields (journey version ID, node ID, customer ID) dynamically as variables in the custom action payload
  • Use the custom action in a journey to write custom events to an AEP dataset

Glossary:

  • HTTP API Inlet: An Adobe Experience Platform source connector that creates a streaming endpoint for ingesting data via HTTP POST requests (product-specific)
  • OAuth Server-to-Server: An authentication credential type in Adobe Developer Console that generates Bearer tokens for server-to-server API calls without user interaction (product-specific)
  • Custom authorization: A Journey Optimizer custom action authentication type that fetches a Bearer token from a specified endpoint and caches it for a configured duration (product-specific)
  • XDM entity: The data payload structure conforming to the Experience Data Model schema, used as the body when writing events to AEP via the HTTP API inlet (product-specific)
  • cacheDuration: The token cache setting in custom authorization configuration that controls how long the fetched Bearer token is reused before a new one is requested (product-specific)

Guardrails:

  • After creating the Adobe Developer Console project, developer and API access control permissions must be explicitly granted before the credentials can be used
  • The HTTP API inlet source must be created with authentication enabled; the connection endpoint URL and schema payload must be copied and stored for use in the custom action configuration
  • Custom action headers must include Content-Type, Charset, and sandbox-name
  • Fields intended to be populated dynamically at runtime must be changed from Constant to Variable in the custom action payload configuration

Terminology:

  • Canonical name: Custom action — Acronym: none — variants: custom action configuration, Journey Optimizer custom action
  • Canonical name: Adobe Experience Platform — Acronym: AEP — variants: Experience Platform, Platform
  • Synonyms: “HTTP API Inlet” = “streaming endpoint” = “DCS collection endpoint”
  • Do not confuse: “OAuth Server-to-Server” ≠ “OAuth user authentication” (Server-to-Server does not require a user login; it uses client credentials)

FAQ:

  • Q: What type of authentication is used to call the AEP HTTP API Inlet from a Journey Optimizer custom action? — Custom Bearer token authentication using OAuth Server-to-Server client credentials fetched from the Adobe IMS token endpoint.
  • Q: Where do I find the client_id, client_secret, grant_type, and scope values? — From the OAuth Server-to-Server credentials section of your Adobe Developer Console IO project, by clicking “View cURL command.”
  • Q: How do I make journey-specific fields (e.g., journeyVersionId, nodeId) dynamic in the payload? — Change their field configuration from Constant to Variable in the custom action payload setup so they are populated from the journey context at runtime.
  • Q: What permissions are required on the Adobe Developer Console project? — Developer and API access control must be granted with the right permissions after the project is created, as described in the AEP API authentication documentation.
  • Q: What is the purpose of the cacheDuration setting in the authentication payload? — It controls how long the fetched Bearer token is cached and reused (28,000 seconds in the example) before the custom action requests a new token.
recommendation-more-help
journey-optimizer-help