preamble
Add a new header and additional rows to a data extract.
Introduction
Use the preamble enrichment to add a new header to your data extract. You can also add new rows beneath the new header. The existing header is moved down the data extract and becomes a new row.
Enter the new headers in the order in which they will be displayed. You can skip a column header by entering a blank field (as shown in the example below).
If you add in a new row, ensure the number of fields matches the number of new headers.
Creating the enrichment
For more information on creating an enrichment, see Using custom scripts.
Configuring the enrichment
To configure the enrichment, fill in the following fields. Required fields are marked with an asterisk (*).
-
Fields*
-
Click
Add and enter the name of the new header to add. The order of the new headers is the orders in which they are added to the data extract.
-
To add in a new row beneath the header, click
Add, beneath the cross
and enter the name of the value to add under the header. See the figure below.
-
Subtable
-
Enter the name for a subtable that you want to contain the enriched data. The enrichment is applied to the whole data extract, then the enriched data is output into the subtable you have named here.
This subtable is a temporary table, which means it only exists for this custom script. You can apply additional instructions within the same custom script to the subtable. However, the subtable cannot be used in any other custom scripts.
An example of how to add new rows to the preamble instruction.
Example
Enrichment configuration
-
Fields*
-
Headers: Campaign Name, [LEAVE BLANK], Number of Clicks
New row values: Spring Collection, tik-tok ads, 165
Data table before enrichment
Campaign |
Ad Group |
Clicks |
---|---|---|
Brand |
media |
7 |
Brand |
ecommerce |
3 |
Dashboard |
media |
18 |
Brand |
ecommerce |
4 |
Dashboard |
media|social |
5 |
Dashboard |
media |
11 |
Data table after enrichment
Campaign Name |
|
Number of Clicks |
---|---|---|
Spring Collection |
tik-tok ads |
165 |
Campaign |
Ad Group |
Clicks |
Brand |
media |
7 |
Brand |
ecommerce |
3 |
Dashboard |
media |
18 |
Brand |
ecommerce |
4 |
Dashboard |
media|social |
5 |
Dashboard |
media |
11 |