# 6.6 External Audiences

In many cases your company may want to use existing segments from other applications to enrich the customer profile in Adobe Experience Platform. Those external audiences may have been defined based on a data science model or using external data platforms.

The external audiences feature of Adobe Experience Platform lets you focus on the ingestion of the external audiences and their activation without any need to redefine the corresponding segment definition in detail in Adobe Experience Platform.

The overall process is divided in three main steps:

* Import the external audience metadata: this step is meant to ingest the external audience metadata, such as the audience name, into Adobe Experience Platform.
* Assign the external audience memebrship to the cutomer profile: this step is meant to enrich the customer profile with the external segment membership attribute.
* Create the segments in Adobe Experience Platform: this step is meant to create actionable segments based on the external audiences membership.

## 6.6.1 Metadata

Go to [Adobe Experience Platform](https://experience.adobe.com/platform). After logging in, you'll land on the homepage of Adobe Experience Platform.

![Data Ingestion](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d3766e8abcdcae565589d172ff39148a026b3712%2Fhome.png?alt=media)

Before you continue, you need to select a **sandbox**. The sandbox to select is named `--module2sandbox--`. You can do this by clicking the text **\[!UICONTROL Production Prod]** in the blue line on top of your screen. After selecting the appropriate \[!UICONTROL sandbox], you'll see the screen change and now you're in your dedicated \[!UICONTROL sandbox].

![Data Ingestion](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fa895e5ee317a5a305f6fdf0b5ed8e73236f5155%2Fsb1.png?alt=media)

While the segment data defines the condition for a profile to be part of a segment, the segment metadata are information about the segment such as the name, the description and the status of the segment. As the external audiences metadata will be stored in Adobe Experience Platform, you need to use an identity namespace to ingest the metadata in Adobe Experience Platform.

## 6.6.1.1 Identity Namespace for External Audiences

An identity namespace has already been created for usage with **External Audiences**. To view the identity that was already created, go to **Identities**, and search for **External**. Click on the "External Audiences" item.

Please note:

* The identity symbol **externalaudiences** will be used in the next steps to refer to the external audiences identity.
* The **Non-people identifier** type is used for this identity namespace, as this namespace isn't meant to identify customer profiles but segments.

![External Audiences Identity](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-23c94091731e475dddbbd309def8392d2cc33063%2FextAudIdNS.png?alt=media)

## 6.6.1.2 Create the External Audiences Metadata schema

The external audiences metadata are based on the **Segment definition Schema**. You can find more details in the [XDM Github repository](https://github.com/adobe/xdm/blob/master/docs/reference/classes/segmentdefinition.schema.md).

In the left menu, go to Schemas. Click **+ Create Schema** and then click **Browse**.

![External Audiences Metadata Schema 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-7d63118dfd94cd1d851419e845cbaa7c5da611d8%2FextAudMDXDM1.png?alt=media)

To assign a class, search for **segment definition**. Select the **Segment definition** class and click **Assign Class**.

![External Audiences Metadata Schema 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f55b5e98aff565d54ce06fec6b6839405ebcbcc1%2FextAudMDXDM2.png?alt=media)

You'll then see this. Click **Cancel**.

![External Audiences Metadata Schema 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-dc4c4dd8521875d0608b176168b2268b33ab43de%2FextAudMDXDM3.png?alt=media)

You'll then see this. Select the field **\_id**. In the right menu, scroll down and enable the **Identity** and the **Primary identity** check boxes. Select the **External Audiences** identity namespace. Click **Apply**.

![External Audiences Metadata Schema 4](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f4ce186c7990e57c19cc85fffbc92b3f239f3c16%2FextAudMDXDM4.png?alt=media)

Next, select the schema name **Untitled schema**. Change the name to `--demoProfileLdap-- - External Audiences Metadata`.

![External Audiences Metadata Schema 5](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-acfdfb0d99733db1650c543f85e538773e0b7e74%2FextAudMDXDM5.png?alt=media)

Enable the **Profile** toggle and confirm. Finally, click **Save**.

![External Audiences Metadata Schema 5](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f2b2783101ab07c8df58f0e397c517c97c76a034%2FextAudMDXDM6.png?alt=media)

## 6.6.1.3 Create the External Audiences Metadata dataset

In **Schemas**, go to **Browse**. Search and click the `--demoProfileLdap-- - External Audiences Metadata` schema you created in the previous step. Next, click **Create Dataset from Schema**.

![External Audiences Metadata DS 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-969fb40dfa8da74f7f6bb3bf54f8570f13fa42f7%2FextAudMDDS1.png?alt=media)

For the field **Name**, enter `--demoProfileLdap-- - External Audience Metadata`. Click **Create dataset**.

![External Audiences Metadata DS 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-e219a153077a2d1c84e5a4657994b00d42070b04%2FextAudMDDS2.png?alt=media)

You'll then see this. Don't forget to enable the **Profile** toggle!

![External Audiences Metadata DS 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-45812edec29b6b015ba10515f8ac3148d0dec37c%2FextAudMDDS3.png?alt=media)

## 6.6.1.4 Create an HTTP API Source Connection

Next, you need to configure the HTTP API Source Connector which you'll use to ingest the metadata into the dataset.

Go to **Sources**. In the search field, enter **HTTP**. Click **Add data**.

![External Audiences Metadata http 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f5e55eecc81297d36e8165b2a238a13a9f8a7ae4%2FextAudMDhttp1.png?alt=media)

Enter the following information:

* **Account type**: select **New account**
* **Account name**: enter `--demoProfileLdap-- - External Audience Metadata`
* Check the checkbox **XDM compatible box**

Next, click **Connect to source**.

![External Audiences Metadata http 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d4e8babe0a66e0f99a6de4e55d1b01c94bd271c7%2FextAudMDhttp2.png?alt=media)

You'll then see this. Click **Next**.

![External Audiences Metadata http 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f189b0c32382235c9e17aad1493c9204273e1eb8%2FextAudMDhttp2a.png?alt=media)

Select **Existing dataset** and in the dropdown menu, search and select the dataset `--demoProfileLdap-- - External Audience Metadata`.

Verify the **Dataflow details** and then click **Next**.

![External Audiences Metadata http 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-ccf638a41d5e6d86bf2fb81599187ef97cc0d825%2FextAudMDhttp3.png?alt=media)

You'll then see this.

The **Mapping** step of the wizard is empty as you'll be ingesting an XDM compliant payload into the HTTP API Source Connector, so no mapping is required. Click **Next**.

![External Audiences Metadata http 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-11dee3bd1b1e73638c7ad8090db429d2342534cf%2FextAudMDhttp3a.png?alt=media)

In the **Review** step you can optionally review the connection and the mapping details. Click **Finish**.

![External Audiences Metadata http 4](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d0478875ab7863aa1e479449ea0cea903db431fc%2FextAudMDhttp4.png?alt=media)

You'll then see this.

![External Audiences Metadata http 4](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fb0323bed5ff06e8c9f9681d9c8de8b466910ffa%2FextAudMDhttp4a.png?alt=media)

## 6.6.1.5 Ingestion of External Audiences metadata

On your Source Connector overview tab, click **...** and then click **Copy schema payload**.

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-6fd63178760529239113b4e4b0c7fa36e2970c43%2FextAudMDstr1a.png?alt=media)

Open your Text Editor application on your computer and paste the payload you just copied, which looks like this. Next, you need to update the **xdmEntity** object in this payload.

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-22ad6833cf6cbca4ef088f05978c6db3ce0ca179%2FextAudMDstr1b.png?alt=media)

The object **xdmEntity** needs to be replaced by the below code. Copy the below code, and paste it into your text file by replacing the **xdmEntity** object in the text editor.

```
"xdmEntity": {
    "_id": "--demoProfileLdap---extaudience-01",
    "description": "--demoProfileLdap---extaudience-01 description",
    "segmentIdentity": {
      "_id": "--demoProfileLdap---extaudience-01",
      "namespace": {
        "code": "externalaudiences"
      }
    },
    "segmentName": "--demoProfileLdap---extaudience-01 name",
    "segmentStatus": "ACTIVE",
    "version": "1.0"
  }
```

You should then see this:

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-7e5eddf5768e0ce17d0f99de3c5254af28fb55dc%2FextAudMDstr1.png?alt=media)

Next, open a new **Terminal** window. Copy all the text in your Text Editor and paste it in the terminal window.

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5218f29279a711266319cc59b6a691925699a253%2FextAudMDstr1d.png?alt=media)

Next, hit **Enter**.

You'll then see a confirmation of your data ingestion in the Terminal window:

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8c2bbc97cdb913e43b0098e8b063d8f2d9123ac5%2FextAudMDstr1e.png?alt=media)

Refresh your HTTP API Source connector screen, where you'll now see that data is being processed:

![External Audiences Metadata str 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-c7471aa9774badca23a3a244c84e9277f15a6f96%2FextAudMDstr2.png?alt=media)

## 6.6.1.6 Validate External Audiences metadata ingestion

When the processing is completed you can check the data availability in the dataset using Query Service.

In the right menu, go to **Datasets** and select the `--demoProfileLdap-- - External Audience Metadata` dataset you created previously.

![External Audiences Metadata str 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-82f96c7e127cb1b5e2aa11ddc6d771fc1ea53e7c%2FextAudMDstr3.png?alt=media)

In the right menu, go to Queries and click **Create query**.

![External Audiences Metadata str 4](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-98cf23c6ce62fa5bcc4dec78d4ef0b99ce014d45%2FextAudMDstr4.png?alt=media)

Enter the following code and then hit **SHIFT + ENTER**:

```
select * from --demoProfileLdap--_external_audience_metadata
```

In the query results you'll see the external audience's metadata that you ingested.

![External Audiences Metadata str 5](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-828b3acc626acc4945243acfc6099196084b1d15%2FextAudMDstr5.png?alt=media)

## 6.6.2 Segment Membership

With the external audience metadata available you can now ingest the segment membership for a specific customer profile.

You now need to prepare a profile dataset enriched against the Segment membership schema. You can find more details in the [XDM Github repository](https://github.com/adobe/xdm/blob/master/docs/reference/datatypes/segmentmembership.schema.md).

## 6.6.2.1 Create the External Audiences Membership schema

In the right menu, go to **Schemas**. Click **Create Schema** and then click **XDM Individual Profile**.

![External Audiences Profile Schema 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-dade2f5d12caa6175d82bf4c9496ac704183e2e8%2FextAudPrXDM1.png?alt=media)

In the **Add field groups** popup, search for **Profile Core**. Select the **Profile Core v2** field group.

![External Audiences Profile Schema 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f0ee1ff32f8216274aa63807df1fa1b3979911f5%2FextAudPrXDM2.png?alt=media)

Next, in the **Add field groups** popup, search for **Segment membership**. Select the **Segment Membership Details** field group. Next, click **Add field groups**.

![External Audiences Profile Schema 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-6297a994f2e9b76d93d04a227a68639e51672c68%2FextAudPrXDM3.png?alt=media)

You'll then see this. Navigate to the field `--aepTenantId--.identification.core`. Click the **crmId** field. In the right menu, scroll down and check the **Identity** and the **Primary identity** checkboxes. For the **Identity Namespace** select **Demo System - CRMID**.

Click **Apply**.

![External Audiences Profile Schema 4](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-c640d89dba68215e0f42cd8852d5ff9913b6f6b0%2FextAudPrXDM4.png?alt=media)

Next, select the Schema name **Untitled schema**. In the display name field, enter `--demoProfileLdap-- - External Audiences Membership`.

![External Audiences Profile Schema 5](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-630fa14f4eb0a576ab0bd08fd24a102622e3020d%2FextAudPrXDM5a.png?alt=media)

Next, enable the **Profile** toggle and confirm. Click **Save**.

![External Audiences Profile Schema 5](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5192a5afd62a6e9cfd788d3453e74cdc8d8ced90%2FextAudPrXDM5.png?alt=media)

## 6.6.2.2 Create the External Audiences Membership dataset

In **Schemas**, go to **Browse**. Search and click the `--demoProfileLdap-- - External Audiences Membership` schema you created in the previous step. Next, click **Create Dataset from Schema**.

![External Audiences Metadata DS 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9f2c13fb495ca102a50418b7cbfd1af942feb774%2FextAudPrDS1.png?alt=media)

For the field **Name**, enter `--demoProfileLdap-- - External Audiences Membership`. Click **Create dataset**.

![External Audiences Metadata DS 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-15b6464606291bc848d869bcdede5a577a00e45f%2FextAudPrDS2.png?alt=media)

You'll then see this. Don't forget to enable the **Profile** toggle!

![External Audiences Metadata DS 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-29de734b555b5c0484214ef5b96613924eb4edb7%2FextAudPrDS3.png?alt=media)

## 6.6.2.3 Create an HTTP API Source Connection

Next, you need to configure the HTTP API Source Connector which you'll use to ingest the metadata into the dataset.

Go to **Sources**. In the search field, enter **HTTP**. Click **Add data**.

![External Audiences Metadata http 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f5e55eecc81297d36e8165b2a238a13a9f8a7ae4%2FextAudMDhttp1.png?alt=media)

Enter the following information:

* **Account type**: select **New account**
* **Account name**: enter `--demoProfileLdap-- - External Audience Membership`
* Check the checkbox **XDM compatible box**

Next, click **Connect to source**.

![External Audiences Metadata http 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-caf4363c831e9b9c524b46bd1a6dad403af0b5cb%2FextAudPrhttp2.png?alt=media)

You'll then see this. Click **Next**.

![External Audiences Metadata http 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-a1d8b7a4a7d91af223e1b3b28c0a710dab26163f%2FextAudPrhttp2a.png?alt=media)

Select **Existing dataset** and in the dropdown menu, search and select the dataset `--demoProfileLdap-- - External Audiences Membership`.

Verify the **Dataflow details** and then click **Next**.

![External Audiences Metadata http 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-6cd7cd66c5e2dd62f9ef51a220f687567179e9d1%2FextAudPrhttp3.png?alt=media)

You'll then see this.

The **Mapping** step of the wizard is empty as you'll be ingesting an XDM compliant payload into the HTTP API Source Connector, so no mapping is required. Click **Next**.

![External Audiences Metadata http 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-47143e70e6678b381705a6207aab5146a5224ba3%2FextAudPrhttp3a.png?alt=media)

In the **Review** step you can optionally review the connection and the mapping details. Click **Finish**.

![External Audiences Metadata http 4](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-bd6ef9e7fa2749c4406457fdd554be5bb4f12621%2FextAudPrhttp4.png?alt=media)

You'll then see this.

![External Audiences Metadata http 4](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9a8ffe552727c630beb676605ed1f58ea856ae6d%2FextAudPrhttp4a.png?alt=media)

## 6.6.2.4 Ingestion of External Audiences Membership data

On your Source Connector overview tab, click **...** and then click **Copy schema payload**.

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d14341d1f7a061e1ea1ab4443126c85cda3f1b7e%2FextAudPrstr1a.png?alt=media)

Open your Text Editor application on your computer and paste the payload you just copied, which looks like this. Next, you need to update the **xdmEntity** object in this payload.

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-3af1040cd9f1bd8174fd22eefbbd7ededa0f5879%2FextAudPrstr1b.png?alt=media)

The object **xdmEntity** needs to be replaced by the below code. Copy the below code, and paste it into your text file by replacing the **xdmEntity** object in the text editor.

```
  "xdmEntity": {
    "_id": "--demoProfileLdap---profile-test-01",
    "_experienceplatform": {
      "identification": {
        "core": {
          "crmId": "--demoProfileLdap---profile-test-01"
        }
      }
    },
    "personID": "--demoProfileLdap---profile-test-01",
    "segmentMembership": {
      "externalaudiences": {
        "--demoProfileLdap---extaudience-01": {
          "status": "realized",
          "lastQualificationTime": "2022-03-05T00:00:00Z"
        }
      }
    }
  }
```

You should then see this:

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-38c3e0e37cd67eaa4e108c22a75f2ced17d94a87%2FextAudPrstr1.png?alt=media)

Next, open a new **Terminal** window. Copy all the text in your Text Editor and paste it in the terminal window.

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d4646f45d545aae79a7c2587e6c0e1e571b694ed%2FextAudPrstr1d.png?alt=media)

Next, hit **Enter**.

You'll then see a confirmation of your data ingestion in the Terminal window:

![External Audiences Metadata str 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-ae4370a20eff71429f94d8b1c2f46a9a085e1091%2FextAudPrstr1e.png?alt=media)

Refresh your HTTP API Source connector screen, where after a couple of minutes you'll now see that data is being processed:

![External Audiences Metadata str 2](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-2fb0ae6530c4be3349b16d3ad5d0455354098238%2FextAudPrstr2.png?alt=media)

## 6.6.2.5 Validate External Audiences Membership ingestion

When the processing is completed you can check the data availability in the dataset using Query Service.

In the right menu, go to **Datasets** and select the `--demoProfileLdap-- - External Audiences Membership` dataset you created previously.

![External Audiences Metadata str 3](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-e13def9e6f6591a698db25d25ac4048c2329c6c2%2FextAudPrstr3.png?alt=media)

In the right menu, go to Queries and click **Create query**.

![External Audiences Metadata str 4](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-ccefa0f54922dacb45f57301a00320c184c4f43c%2FextAudPrstr4.png?alt=media)

Enter the following code and then hit **SHIFT + ENTER**:

```
select * from --demoProfileLdap--_external_audiences_membership
```

In the query results you'll see the external audience's metadata that you ingested.

![External Audiences Metadata str 5](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-1a225cf462c1e46968d823dfb7d314a87eb4296c%2FextAudPrstr5.png?alt=media)

## 6.6.3 Create a segment

Now you are ready to to take action on the external audiences. In Adobe Experience Platform taking action is achieved via creating segments, populating the respective audiences and sharing those audiences to the destinations. You'll now create a segment using the external audience you just created.

In the left menu, go to **Segments** and click **Create segment**.

![External Audiences SegBuilder 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-cfcd777ffe95ea4793dec2efb3c97344bb483094%2FextAudSegUI2.png?alt=media)

Go to **Audiences**. You'll then see this. Click **External Audiences**.

![External Audiences SegBuilder 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-e23efb3de6c84de725eedf816a4c386a38f8a785%2FextAudSegUI2a.png?alt=media)

Select the external audience you created earlier, which is named `--demoProfileLdap---extaudience-01`. Drag and drop the audience onto the canvas.

![External Audiences SegBuilder 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-16136c687820641907eaf100f72a3bfde43bd8ec%2FextAudSegUI2b.png?alt=media)

Give your segment a name, use `--demoProfileLdap-- - extaudience-01`. Click **Save and Close**.

![External Audiences SegBuilder 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-401ddcbef0e036e0f789849d1eb381f45d3d7b02%2FextAudSegUI1.png?alt=media)

You'll then see this. You'll also notice that the profile for which you ingested the segment membership now shows in the list of **Sample Profiles**.

![External Audiences SegBuilder 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f5237a5b1f27e4127bf88d03ae4a4d5b2edd9bcb%2FextAudSegUI3.png?alt=media)

Your segment is ready now, and can be sent towards a destination for activation.

## 6.6.4 Visualize your customer profile

You can now also visualize the segment qualification on your customer profile. Go to **Profiles**, use the identity namespace **Demo System - CRMID** and provide the identity `--demoProfileLdap---profile-test-01`, which you used as part of exercise 6.6.2.4, and click **View**. Next, click the **Profile ID** to open the profile.

![External Audiences SegBuilder 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-570b753780d4481a0fc652866ddb4ae04eddd28f%2FextAudProfileUI1.png?alt=media)

Go to **Segment membership**, where you'll see your external audience appear.

![External Audiences SegBuilder 1](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-cbd2e75b8a69e8fb6c66fd1e0a272459e86fbf47%2FextAudProfileUI2.png?alt=media)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module6/ex6.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
