breakOutSegments: This is an array of all the segments you want to have. You can define as many as you want. The important thing to remember is that you must apply the same labels to the actual campaigns that belong to that segment. Also, you shouldn’t have any overlaps between the labels, otherwise there will be duplicate spend in the pulled data.
Label: the label you applied to the campaigns within the segment
Sheet: the name of the sheet where you want the data to appear in your spreadsheet. You can write each segment’s cost data to separate sheets if you want.
Column: the column in which to write the cost data for the segment in question, e.g. “B”.
dateRangeSheet: This is the name of the sheet where your date range cells located.
startDateCell: The first part of this array is the cell range including both date “helper” cells. The accepted format is “A1:B1”. The second part is the position of the start date within that range (row 1, column 1).
endDateCell: Same as above, only the position reference differs (row 1, column 2).
Note that you MUST configure all these variables correctly in order for the script to run.
Some other things you need to consider when formatting your spreadsheet:
The first row of the spreadsheet is always reserved for title, account name, etc.
The second row is reserved for the headers (Date, Costs, Daily total, Running total, Next day’s target).
The cost data always starts from the 3rd row.
Column A is reserved for the dates.
These rules are hard-coded in the script and to change these you have to modify other parts of the script. You are encouraged to experiment!
Example: Not Working