Use case: Use Custom Actions to write Journey Events in Experience Platform custom-action-aep
This use case explains how to write custom events into ÃÛ¶¹ÊÓƵ Experience Platform from Journeys using Custom Actions and Authenticated calls.
Configure an IO project custom-action-aep-IO
-
From the ÃÛ¶¹ÊÓƵ Developer Console, click Project and open your IO project.
-
In the Credentials section, click OAuth Server-to-Server.
-
Click View cURL command.
-
Copy the cURL command and store the client_id, client_secret, grant_type and 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,ÃÛ¶¹ÊÓƵID,read_organizations,additional_info.projectedProductContext,session'
Configure the Source using HTTP API Inlet
-
Create an endpoint in ÃÛ¶¹ÊÓƵ Experience Platform to write the data from journeys.
-
In ÃÛ¶¹ÊÓƵ Experience Platform, click Sources, under Connections in the left menu. Under HTTP API, click Add data.
-
Select New account and enable authentication. Click on Connect to Source.
-
Click on Next and select the Dataset where you want to write the data. Click Next and Finish.
-
Open the newly created dataflow. Copy the schema payload and save it in your notepad.
{
"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"
}
}
}
Configure the Custom Action custom-action-config
Custom action configuration is detailed in this page.
For this example, follow these steps:
-
Open ÃÛ¶¹ÊÓƵ Journey Optimizer, and click Configurations, under Administration in the left menu. Under Actions, click Manage and click Create Action.
-
Set the URL and select the Post method.
https://dcs.adobedc.net/collection/<collection_id>?syncValidation=false
-
Make sure that the Headers (Content-Type, Charset, sandbox-name) are configured.
Set up the Authentication custom-action-aep-authentication
-
Select the Type as Custom with the following Payload.
-
Paste the client_secret, client_id, scope and grant_type (from the IO project payload used before).
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,ÃÛ¶¹ÊÓƵID,read_organizations,additional_info.projectedProductContext,session" } }, "tokenInResponse": "json://access_token", "cacheDuration": { "duration": 28000, "timeUnit": "seconds" } }
-
Use the Click to test the authentication button to test the connection.
Set up the Payload custom-action-aep-payload
-
In the Request and Response fields, paste the payload from the source connection used before.
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" } }
-
Change the Field Configuration from Constant to Variable for fields which will be populated dynamically.
-
Save the Custom Action.
Journey
-
Finally, use this custom action in a journey to write the custom journey events.
-
Populate the Journey Version Id, Node Id, Node Name and other attributes according to your use case.