Expand my Community achievements bar.

From Data to Decisions: Offer Log Mastery with Query Pro Mode

Avatar

Employee

10/11/24

From Data to Decisions: Offer Log Mastery with Query Pro Mode

Author: @annamalai  (Senior Product Manager)

Reviewer: Arun Manoharan (Director Product Manager)

SQL: Jabeerulla Shaik (Software Development Engineer)

In the world of campaigns, real-time offers, and decisioning, one key governance activity is auditing what offers and decisions were made programmatically. This becomes even more important and interesting for highly regulated industries like health care, financial services, telecom, etc. Campaign managers and marketing technologists often collaborate with data analysts to understand and build reports that present an auditable view of offers and other marketing activities.

In this document, we will show how to enable marketing campaign managers and analysts to build reports with the easy-to-use Data Distiller's Query Pro Mode template.

Use Cases

At Offer Level: Select one or more offer IDs and see the profile identities

At Profile Level: Select one or more profile identities and see the offer & placement details.

Step 1: Access The Dataset

I will use the ODE Decision Events dataset, a system-generated dataset from Adobe Offer Decisioning. While this blog follows the system-generated dataset, you can perform the same analysis on any datasets you bring to the Adobe Experience platform or from a derived dataset from the system-generated dataset. You can also bring in the post-offer delivery feedback dataset and perform the analysis on the combination of both the system datasets and the feedback dataset.

annamalai_0-1728692961655.png

Step 2: Write The SQL

Feel free to explore the dataset(s) using the query editor to arrive at the data you need for your analysis. For this blog, I am focusing on retrieving the profile identities and offer placement details from the system dataset, and the SQL I used is provided below. Please note that the table name “ode_decisionevents_emea_uk_sc_decisioning” is specific to the sandbox dataset name from the previous step. You will have to find the table specific to your sandbox and replace it in the SQL.

 

 

 SELECT
  profile,
  propositionDetails.placement.id placementID,
  propositionDetails.placement.name placementLabel,
  COALESCE(selection.id, fallback.id) offerID,
  (
    CASE
      WHEN (
        (selection.id IS NOT NULL)
        AND (selection.name IS NOT NULL)
      ) THEN selection.name
      ELSE fallback.name
    END
  ) offerLabel,
  (
    CASE
      WHEN (
        (selection.id IS NOT NULL)
        AND (selection.name IS NOT NULL)
      ) THEN false
      ELSE true
    END
  ) isFllbackOffer
FROM
  (
    SELECT
      CONCAT(key, ':', VALUE[0].id) AS profile,
      _experience.decisioning.propositionid propositionID,
      _experience.decisioning.propositiondetails AS propositionDetails,
      _experience.decisioning.propositiondetails.fallback fallback,
      explode_outer (
        _experience.decisioning.propositiondetails.selections
      ) selection
    FROM
      (
        SELECT
          explode (identitymap),
          *
        FROM
          ode_decisionevents_emea_uk_sc_decisioning
      ) flattened_namespace
  ) AS flattened_decisioning_events
GROUP BY
  profile,
  propositionDetails,
  fallback,
  selection;

 

 

Step 3: Build Data Model

Now, I can persist the result of the SQL analysis from Step 2 in the accelerated store for easy analysis by business and marketing personas. I can build the necessary data model and then create the charts for the template using Data Distiller Query Pro mode.

Here are the SQL for the data model creation, including the table to store the results from Step 2:

 

 

--Create a database to store all the tables for our dataset based dashboard/chart creation
create database offersanalysis
with
  (
    TYPE = QSACCEL,
    ACCOUNT = acp_query_batch
  );
--Create a schema to store all the tables for our insights data model
create schema offersanalysis.offersanalysismodel;
--Provide the insights data model a user friendly name that shows up in the dashboard section
ALTER MODEL offersanalysis.offersanalysismodel
RENAME TO offersanalysisinsights;

CREATE TABLE IF NOT EXISTS
  offersanalysis.offersanalysismodel.ode_offer_profile
with
  (DISTRIBUTION = REPLICATE) AS
SELECT
  cast(null as text) profile,
  cast(null as text) placementID,
  cast(null as text) placementLabel,
  cast(null as text) offerID,
  cast(null as text) offerLabel,
  cast(null as text) isFllbackOffer
WHERE
  false;

 

 

Once you have created and inserted the data, you can schedule the refresh of your SQL based on your desired dashboard refresh needs. Note: The schemas for the above data model are visible in the Schemas UI. Once you enable show ad-hoc schemas, you will see the accelerated store schemas. You can use this to set the desired governance labels.

Step 4: Build Offer Proposition Template

Finally, you can start building the desired charts by reviewing the tutorials as follows

  1. Global filter creation: Link
  2. Advanced table widget creation: Link
  3. Data Distiller Query Pro Mode: Link

Below are the filters I have created one for Offer ID and one for Profile Identity

annamalai_1-1728692961657.png

annamalai_2-1728692961659.png

And the table widget I created as well as linked to the two global filter above is as follows:

annamalai_3-1728692961662.png

annamalai_4-1728692961673.png

While in this blog I only cover one table widget, you are welcome to add additional summary metrics such as total offers, count of fall back offers etc. as per your business needs.

Final Outcome

And that's it. You set up this template once, and every day, both business and technical personas can easily visit it, update the filters to select the desired profile identities or Offer IDs, and review the KPIs.

These reports and the ability to introspect offers and campaigns in AJO using native AEP capability open up many different avenues. The reports help marketing teams have better conversations with compliance and governance teams.

annamalai_5-1728692961679.png

annamalai_6-1728692961684.png