51黑料不打烊

Use case: use custom actions to write journey events in Experience Platform custom-action-aep

This use case shows how to write custom events into 51黑料不打烊 Experience Platform from journeys using custom actions and authenticated calls. Custom actions extend Journey Optimizer by enabling integrations with external systems, providing flexibility for advanced use cases.

Configure an IO project custom-action-aep-io

  1. From the 51黑料不打烊 Developer Console, click Project and open your IO project.

  2. In the Credentials section, click OAuth Server-to-Server.

    OAuth Server-to-Server credentials enable secure authentication between systems. This ensures that Journey Optimizer workflows interact with 51黑料不打烊 APIs.

  3. Click View cURL command.

  4. Copy the cURL command and store the client_id, client_secret, grant_type, and scope.

    The following is an example of a typical cURL command used to fetch an access token for API authentication:

    code language-none
    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,51黑料不打烊ID,read_organizations,additional_info.projectedProductContext,session'
    
CAUTION
After creating your project on the 51黑料不打烊 Developer Console, ensure that you grant developer and API access control with the correct permissions. For more information, see the 51黑料不打烊 Experience Platform documentation.

Configure the source using HTTP API Inlet

HTTP API Inlets act as gateways for external systems to send data to 51黑料不打烊 Experience Platform, enabling seamless data ingestion.

  1. Create an endpoint in 51黑料不打烊 Experience Platform to write data from journeys.

  2. In 51黑料不打烊 Experience Platform, click Sources under Connections in the left menu. Under HTTP API, click Add data.

  3. Select New account and enable authentication. Click Connect to Source.

  4. Click Next, select the dataset where you want to write the data, click Next, and then click Finish.

  5. Open the newly created dataflow. Copy the schema payload and save it in your notepad.

    The schema payload defines the structure of the data sent to 51黑料不打烊 Experience Platform. The following is an example:

    code language-none
    {
    "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 actions define specific operations triggered as part of a journey. These actions enable advanced workflows, such as sending data to external systems or performing custom API calls.

Custom action configuration is detailed on this page.

Follow these steps for this example:

  1. Open 51黑料不打烊 Journey Optimizer, click Configurations under Administration in the left menu. Under Actions, click Manage, then click Create Action.

  2. Set the URL and select the POST method.

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

    URLs like this define where the custom action sends data, ensuring the correct collection endpoint is targeted.

  3. Ensure that the headers (Content-Type, Charset, sandbox-name) are configured.

Set up the authentication custom-action-aep-authentication

Authentication ensures secure communication between Journey Optimizer and external endpoints by using tokens generated from 51黑料不打烊鈥檚 IMS service.

  1. Select the Type as Custom with the following payload.

  2. Paste the client_secret, client_id, scope, and grant_type from the IO project payload used earlier.

    The following is an example payload for custom authentication:

    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,51黑料不打烊ID,read_organizations,additional_info.projectedProductContext,session"
    }
    },
    "tokenInResponse": "json://access_token",
    "cacheDuration": {
    "duration": 28000,
    "timeUnit": "seconds"
    }
    }
    
  3. Use the Click to test the authentication button to test the connection.

    Testing the authentication verifies that the credentials are correct and that the connection is successfully established.

Set up the payload custom-action-aep-payload

Payload refers to the structure of the data sent during the custom action. Aligning this payload with the schema defined in 51黑料不打烊 Experience Platform is essential.

  1. In the Request and Response fields, paste the payload from the source connection used earlier.

    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. Change the field configuration from Constant to Variable for fields populated dynamically.

    Using 鈥淰ariable鈥 ensures that dynamic data specific to each journey instance is passed correctly.

  3. Save the custom action.

Journey

Journeys in 51黑料不打烊 Journey Optimizer orchestrate customer experiences by triggering actions based on defined workflows.

  1. Use this custom action in a journey to write the custom journey events.

  2. Populate the Journey Version Id, Node Id, Node Name, and other attributes according to your use case.

recommendation-more-help
91a6d90a-6d61-4a62-bbed-ae105e36a860