This script makes it easier to compare the performance of an account across two date ranges. It downloads reports including account data, campaign data, ad group data, keyword data and ad text data for the two time periods you specify and then combines them into a single Google Spreadsheet that shows the percent change for each item.
Example Use Cases
- Get a report every Monday that shows last week's account performance compared to two weeks ago
- Get a report on the first of the month that shows last month's account performance compared to two months ago
- Get a report that compares the same number of days (and same days of the week) before and after an optimization was made
Settings and Customizations
Replace the following variables with your own values: campaignNameSelectorStatement, time, daysInReport, spreadsheetUrl, includeAccountLevel, includeCampaignLevel, includeAdGroupLevel, includeKeywordLevel, includeAdLevel
The campaignSelectorStatement tells the script on which campaigns to operate. It uses the syntax from AdWords Scripts for .withCondition(condition)
- For example, to operate on all campaigns in an account use: CampaignName CONTAINS_IGNORE_CASE ”
- To work only on the campaign named "Campaign #1", use: CampaignName = 'Campaign #1'
It is optional when you want to include only account level data. Otherwise this is a required value.
time, daysInReport, optimizationDate, preStartDate, preEndDate, postStartDate, postEndDate (required)
These variable tells the script what type of dates to compare. The allowed values are:
- Around Opt
- Last Months
- Previous Days
"Around Opt" tells the script to look before and after the date of an optimization. A value for daysInReport and optimizationDate is required when you use this.
"Specific" tells the scripts that you will tell it the exact start and end dates for the two periods to compare. A value for preStartDate, preEndDate, postStartDate, postEndDate is required when you use this
"Last Months" tells the script to compare last month's data to two months ago.
"Previous Days" tells the script to compare the last x days with the x days before that. The value of x can be specified in daysInReport which is required when you use this.
This variable tells the script the URL of the Google Spreadsheet where it should store the results. Allowed values are either the full URL to a Google Spreadsheet or "NEW". In the case of "NEW", the script will create a new spreadsheet to store the results.
This tells the script if it should include an account level comparison. Set to 1 for yes or 0 for no
This tells the script if it should include a campaign level comparison. Set to 1 for yes or 0 for no
This tells the script if it should include an ad group level comparison. Set to 1 for yes or 0 for no
This tells the script if it should include a keyword comparison. Set to 1 for yes or 0 for no
This tells the script if it should include an ad text level comparison. Set to 1 for yes or 0 for no
Under The Hood
This script compares the values for any account items during two periods of time and reports the percent change. It can be modified to send alerts when there is a big change or it can be modified to try and correlate changes so that it can pinpoint the items that need your attention the most.
Get This Script
You can run this script from the Enhanced Scripts™ section in your Optmyzr account.