addfield
Add a new field to the data extract with a specific value in each row.
Introduction
Use the addfield enrichment to add a new field to the data extract with a specific value in each row.
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 (*).
-
Field Name
-
Specify the name of the new field to add to the data extract.
-
Field Value
-
Specify the value to use in each row of the new field.
-
Field Index
-
Specify where to add the new field in the data extract. To add the field to the first position, specify 0. To add the field to the last position, specify -1.
-
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 Name
-
Country
-
Field Value
-
Austria
-
Field Index
-
2
Data table before enrichment
Campaign |
Ad Group |
Clicks |
---|---|---|
Brand |
media |
7 |
Brand |
ecommerce |
3 |
Dashboard |
media|social |
18 |
Data table after enrichment
Campaign |
Ad Group |
Country |
Clicks |
---|---|---|---|
Brand |
media |
Austria |
7 |
Brand |
ecommerce |
Austria |
3 |
Dashboard |
media|social |
Austria |
18 |