pushheader
Add a new header to a data extract.
This guide explains how to configure the pushheader instruction. To learn about another instruction, go back to the Available custom script instructions overview.
Introduction
Use the pushheader instruction to add a new header to your data extract. 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). This is a simplified version of the preamble instruction.
Creating a custom script transformation using the pushheader instruction
To create and configure a custom script using the pushheader instruction, follow these steps:
-
In the Instructions step, select the pushheader instruction.
-
To configure the custom script instruction, fill in the following fields. Required fields are marked with an asterisk (*).
-
Header*
-
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 leave a header field empty, leave the text field empty, as shown in the image below.
-
Subtable
-
Enter the name for a subtable that you want to use within this custom script.
A subtable is a temporary table that 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.
If a subtable does not exist for the current custom script, the transformation is applied to the data extract, and the enriched data is output into the subtable. If the subtable already exists for the custom script, the subtable is used as the input for the transformation and optionally as the output.
Example
Transformation configuration
-
Header*
Data table before transformation
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 transformation
Campaign Name |
|
Number of Clicks |
---|---|---|
Campaign |
Ad Group |
Clicks |
Brand |
media |
7 |
Brand |
ecommerce |
3 |
Dashboard |
media |
18 |
Brand |
ecommerce |
4 |
Dashboard |
media|social |
5 |
Dashboard |
media |
11 |