Advanced Adobe Analytics events data configuration
This guide explains how to create a transformation 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 a transformation 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 a transformation script that will combine the events data into a single column, follow these steps:
-
Go to the Transformations page.
-
In the top right corner, click + Create transformation.
-
Click Custom Script.
-
To assign the transformation to individual datastreams of your choice, follow these steps:
-
In the Assign to section, select Individual datastreams.
-
In the drop-down menu, select the datastreams to assign the transformation to them.
-
-
To assign the transformation to all existing and new datastreams that belong to Datastream Types of your choice, follow these steps:
-
In the Assign to section, select Datastreams Types.
-
In the drop-down menu, select the Datastream Types to assign the transformation to all datastreams that belong to these types.
-
(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 transformation to them.
-
-
Click Next.
-
In Select Instruction, enter and select addfieldx.
-
In Fieldname, enter the value events. This is the name of the new column that will be created using the transformation instruction.
-
In Python Expression, enter the following code. Replace the values of
eventA
andeventB
with the corresponding Adobe Analytics events column names from the data extract (For example, these names could beclicks
andCTR
, orev_c
andev_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.
-
Click Next.
-
(Optional) In Transformation name, rename the transformation.
-
Click Create +.
As a result, the transformation is created and can be applied to the relevant datastream.
Applying the transformation to a datastream
To apply the transformation to a datastream, follow these steps:
-
Go to the Datastreams page.
-
Click the datastream to which you want to apply the transformation.
-
In the Transformations section, click + Add transformation.
-
Click Assign Existing transformation.
-
To the right of the transformation you want to apply to the datastream, click + Assign
-
In the top right corner of the page, click Close to close the Assign transformations window.
As a result, the transformation is added to the datastream. Click Fetch now to collect data in the datastream with the applied transformation 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.