Audience Activation

The Audience Activation extension lets you activate Real-Time CDP audiences in Adobe Commerce to create unique offers in the cart. These offers and incentives include common ecommerce merchandising techniques, such as buy 2 get 1 free, hero banners geared toward that customer, and modified product pricing through various offers. The audiences built within Real-Time CDP are based on data from various enterprise systems, such as Enterprise Resource Planning (ERP), Customer Relationship Management (CRM), point of sale, and marketing systems. Because customer segment information is constantly refreshed, customers can become associated and disassociated from a segment as they shop in your store.

You can activate audiences in a Luma storefront or headless storefront. In a Luma storefront, audience information (segment membership) is stored in a cookie on the Commerce side. In a headless storefront, audience information is passed in the GraphQL API header as a parameter named: aep-segments-membership.

Release notes

This section contains information about updates to the Audience Activation extension and includes:

  • New - New features
  • Fix - Fixes and improvements
  • Bug - Known issues

See Upcoming Releases to learn about release schedules and support.

See the developer documentation to learn about product compatibility.

Supported service updates

These release notes describe feature changes and fixes related to extensions used by Audience Activation.

 Supported service updates

May 30, 2023

1.1.0

Compatibility Adobe Commerce versions 2.4.4 and newer

1.0.1

May 11, 2023

Compatibility Adobe Commerce versions 2.4.4 and newer

  • Fix - Fixed an issue where a dynamic block or cart price rule was not applied to the storefront.
  • Fix - Fixed an issue where an unconfigured installation of the Audience Activation extension caused an error when a merchant tried to create or update a dynamic block.

1.0.0

March 31, 2023

Compatibility Adobe Commerce versions 2.4.4 and newer

  • New - General availability release

Implementation

The following tasks apply to both Luma and headless storefront implementations. To activate audiences in Adobe Commerce, you must:

Install the extension

You can install the Audience Activation extension from the marketplace or you can run the following command:

composer require magento/audiences

Configure the extension

After you install the Audience Activation extension, you must log into your Commerce Admin and complete the following:

  1. On the Admin sidebar, go to System > Services > Commerce Services Connector.

  2. Sign in to your Adobe account and select your organization ID.

  3. On the Admin sidebar, go to System > Services > Experience Platform Connector.

  4. In the Datastream ID field, paste the ID of the datastream that you created when you activated Adobe Commerce as a destination in Real-Time CDP.

    This datastream sends data from your Commerce website to Real-Time CDP to determine if a shopper belongs to an audience. If you have not yet created a datastream, create one in Experience Platform, add it to the Commerce destination in Real-Time CDP, and to the Experience Platform Connector in the Admin.

    NOTE

    When you specify a datastream ID, you associate it to a specific website in the Experience Platform connector. If your Commerce store has multiple websites, create a destination for each website in Real-Time CDP and use a different datastream ID for each.

  5. On the Admin sidebar, go to Stores > Settings > Configuration.

  6. Expand Services and select Real-Time CDP Audiences.

  7. Enter the configuration credentials found in the developer console.

    Real-Time CDP Audience Admin Configuration
  8. Click Save Config.

With audiences activated to your Adobe Commerce instance, you can:

Real-Time CDP audiences dashboard

You can view all active audiences that are available to personalize within your Adobe Commerce instance using the Real-Time CDP Audiences dashboard. Any audiences you activated in the Adobe Commerce destination in Real-Time CDP appear in this dashboard.

To access the Real-Time CDP Audiences dashboard, go to the Admin sidebar, then go to Customers > Real-time CDP Audience. The Real-Time CDP Audiences dashboard appears:

Real-Time CDP Audiences Dashboard
Column Description
Search Filter Section that lets you specify the search criteria. You can search by Audience or Last Modified. If you do not select any criteria or you select all criteria, all audiences are searched.
Search Lets you search for active audiences in your Commerce instance.
Audience Name given to the audience in Real-Time CDP.
Last Modified Indicates when the audience was modified in Real-Time CDP.
Origin Indicates where the audience came from, such as Experience Platform.
Sync now Retrieves new or updated audiences from Real-Time CDP.

Headless support

You can activate audiences in a headless Adobe Commerce instance, such as AEM and PWA. A headless storefront communicates to the Experience Platform through the Commerce Integration Framework (CIF). The framework provides a server-side API that is implemented using GraphQL. Audience information, like which segment a shopper belongs to, is passed to Commerce through a GraphQL header parameter named: aep-segments-membership.

The overall architecture is as follows:

Sending Data from Headless Storefront to Backend

After you install and configure the extension, the Experience Platform Web SDK contains the audience information in the form of segment membership.

To capture those segment memberships from the SDK, see this code snippet.

After it is retrieved, you can pass those segments to Commerce within the GraphQL header. For example:

curl 'http://magento.config/graphql' -H 'Authorization: Bearer abc123' -H 'aep-segments-membership: urlencoded_list_of_segments' -H 'Content-Type: application/json' --data-binary '{"query":"query {\ncustomer {\nfirstname\nlastname\nemail\n}\n}"}'

Dynamic blocks

You can use dynamic blocks in a headless storefront. GraphQL dynamicBlocks queries can contain the audience_id input attribute. If you specify one or more audience_id values in a dynamicBlocks query, it returns a list of dynamic blocks assigned to those audiences.

Example usage

The following query returns all dynamic blocks associated with multiple audience IDs.

Request:

{
  dynamicBlocks(input:
  {
    type: SPECIFIED
    audience_id: {
      in: [
        "cd29a789-9be8-40ad-a1ef-640c33b3742e"
        "92c3e14d-c72b-40d0-96b7-b96801dcc135"
      ]
    }
  })
  {
    items {
      uid
      audience_id
      content {
        html
      }
    }
    page_info {
      current_page
      page_size
      total_pages
    }
    total_count
  }
}

Response:

{
  "data": {
    "dynamicBlocks": {
      "items": [
        {
          "uid": "MQ==",
          "audience_id": [
            "cd29a789-9be8-40ad-a1ef-640c33b3742e"
          ],
          "content": {
            "html": "<h2><strong>SAVE 20%</strong></h2>\r\n<p>(some restrictions apply)</p>\r\n<p>&nbsp;</p>"
          }
        },
        {
          "uid": "Mg==",
          "audience_id": [
            "cd29a789-9be8-40ad-a1ef-640c33b3742e",
            "92c3e14d-c72b-40d0-96b7-b96801dcc135"
          ],
          "content": {
            "html": "<p><img src=\"{{media url=&quot;wysiwyg/save20.png&quot;}}\" alt=\"save 20% red\"></p>"
          }
        }
      ],
      "page_info": {
        "current_page": 1,
        "page_size": 20,
        "total_pages": 1
      },
      "total_count": 2
    }
  }
}

Learn more about the dynamicBlocks GraphQL query in the developer documentation.

NOTE

An AEM storefront does not support dynamic blocks.

On this page