setheader
Rename the columns in your data extract.
Introduction
Use the setheader enrichment to change the names of the columns in a data extract. You must provide a name for each column in the data extract, even if you do not wish to rename the column. Any column that does not have a name provided is removed from the data extract. See the example below.
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 (*).
-
Header*
-
Click
and enter the new names for the columns. Enter the names in the order in which they are to be applied to the columns. If you do not want to change the name of a column, enter its current name. To make sure no columns are removed, enter a name for each column in the data extract.
-
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.
Example
Enrichment configuration
-
Field*
-
Campaign Name
-
Advert Type
-
No. Clicks
Data table before enrichment
Campaign |
Ad Group |
Clicks |
Impressions |
---|---|---|---|
Brand |
media |
7 |
56 |
Branding |
ecommerce |
3 |
96 |
Dashboard |
brand awareness |
18 |
44 |
Brand |
Ecommerce |
4 |
19 |
Dashboard |
media|social |
5 |
33 |
Branding |
media |
11 |
76 |
Data table after enrichment
Campaign Name |
Advert Type |
No. Clicks |
---|---|---|
Brand |
media |
7 |
Branding |
ecommerce |
3 |
Dashboard |
brand awareness |
18 |
Brand |
Ecommerce |
4 |
Dashboard |
media|social |
5 |
Branding |
media |
11 |