Advanced Adobe Analytics events data configuration

This reference explains how to create an enrichment script to load events data into Adobe Analytics.

Introduction

To load Adobe Analytics events data into the Adobe Analytics destination, the events data must be in a specific format.

To conform to this format, use an enrichment script that collects the Adobe Analytics events data into a single column, events, and adds it to the data extract. Multiple columns containing different Adobe Analytics events data need to be joined into a single column, where each of the column values are separated by a comma.

For example, if a data extract contained the following rows:

eventA

eventB

eventC

Row_01_a

Row_01_b

Row_01_c

Row_02_a

Row_02_b

Row_02_b

Row_03_a

Row_03_b

Row_03_c

Then the new column, events, containing the concatenated Adobe Analytics events data is as follows:

events

eventA=Row_01_a,eventB=Row_01_b,eventC=Row_01_c

eventA=Row_02_a,eventB=Row_02_b,eventC=Row_02_c

eventA=Row_03_a,eventB=Row_03_b,eventC=Row_03_c

Prerequisites

Before you complete the procedure in this guide, perform all of the following actions:

  • Create an Adobe Analytics destination. For more information, see Loading data into Adobe Analytics.

  • Find the name of the columns in the data extract that contain the Adobe Analytics events data.

Procedure

To create an enrichment script that will combine the events data into a single column, follow these steps:

  1. Select the workspace you work with in Adverity and then, in the platform navigation menu, click Enrichments.

  1. In the top right corner, click + Create enrichment.

  2. Click Custom Script.

  3. (Optional) To assign the enrichment to individual datastreams of your choice, follow these steps:

    1. In the Assign to section, select Individual datastreams.

    2. In the drop-down menu, select the datastreams to assign the enrichment to them.

  4. (Optional) To assign the enrichment to all existing and new datastreams that belong to Datastream Types of your choice, follow these steps:

    1. In the Assign to section, select Datastreams Types.

    2. In the drop-down menu, select the Datastream Types to assign the enrichment to all datastreams that belong to these types.

    3. (Optional) In the Do not assign to these individual datastreams drop-down menu, select the individual datastreams that belong to the Datastream Types that you have selected, but you do not want to assign the enrichment to them.

  1. Click Next.

  1. In Select Instruction, enter and select addfieldx.

  2. In Fieldname, enter the value events. This is the name of the new column that will be created using the enrichment instruction.

  3. In Python Expression, enter the following code. Replace the values of eventA and eventB with the corresponding Adobe Analytics events column names from the data extract (For example, these names could be clicks and CTR, or ev_c and ev_crt).

    'event01=' + {eventA} + ',' + 'event02=' + {eventB}

    The example above concatenates just two columns of events data. If you have multiple columns of events data to load into Adobe Analytics, you must concatenate every event into a single column.

  1. Click Next.

  1. (Optional) In Enrichment name, rename the enrichment.

  2. Click Create +.

As a result, the enrichment is created and can be applied to the relevant datastream.

Applying the enrichment to a datastream

To apply the enrichment to a datastream, follow these steps:

  1. Select the workspace you work with in Adverity and then, in the platform navigation menu, click Datastreams.

  2. Click the datastream to which you want to apply the enrichment.

  1. In the Enrichments section, click + Add Enrichment.

  2. Click Assign Existing Enrichments.

  3. To the right of the enrichment you want to apply to the datastream, click + Assign

  1. In the top right corner of the page, click Close to close the Assign Enrichments window.

As a result, the enrichment is added to the datastream. Click Fetch now to collect data in the datastream with the applied enrichment to concatenate all the events data into a single line. Adverity places this line of events data in to the new column (events) in the data extract.