Account Dashboard By Label

Purpose

Generate a Google Sheet with time-segmented data and charts for all the elements that you've labeled.
The script can aggregate the data or report on every individual element that has the label. It can do calculations with any of the data (e.g. create new metrics like Conversion Per Impression) and it can compare data for 2 time periods so you can see both seasonality and whether you're doing better or worse than last period.
Download Script

This is an example of the types of charts you can generate for your AdWords account using this script.
This is an example of the types of charts you can generate for your AdWords account using this script.

Example Use Cases

  • Create a dashboard with year-over-year performance graphs for any set of ad groups, campaigns or keywords.
  • Create a dashboard that shows charts for all keywords with the label "My Top Keywords"
  • Create graphs using calculated metrics not directly available in AdWords, for example you could build a chart showing the trend in "Conversions per Impression" for your top ad groups
  • Create charts that group the data for multiple campaigns that have the same label, for example, if you have 2 campaigns to sell widgets, you can graph the aggregate performance of these campaigns by giving them the same label. This is particularly useful if your account management strategy requires you to split up campaigns for different target audiences, e.g. by time zone.

Settings and Customizations

The settings below let you customize how the script works. Simply change the values as needed at the top of the script to fit your needs.

  • SPREADSHEET: The URL of the Google spreadsheet that will receive the data. Make sure this spreadsheet has added your AdWords login email address as an editor. Otherwise the script will fail because it can't access the spreadsheet.
  • LABELS = new Array("Label 1", "Label 2"); Replace "Label 1" and "Label 2" with the label names you want to build a report for. You can add additional labels as needed, just be sure to enclose the name in quotes and separate each label with a comma
  • LEVEL: The script can only report on one type of item so choose campaigns, keywords, or ad groups
  • STARTDAYSAGO: This tells the script how many days back to start your report
  • TIMESEGMENT: This tells the script how to segment the report by time, valid choices are Week, Date, Month, Quarter (capitalization matters!)

Advanced Customizations

  • METRICS: This is a list of objects to tell the script which metrics to include in the tables. These metrics should NOT be ratios so not Ctr or ConversionRate. Instead include only metrics that are not calculated based on other metrics in AdWords. For name, you can include any metric that is included in a standard AdWords performance report (documentation: https://developers.google.com/adwords/api/docs/appendix/reports#ad-group). Some example values we find useful are Conversions, Clicks, Impressions, Cost, TotalConvValue. For each of these metrics, you can also include modifierForNewMetric and modifierForOldMetric. These let you calculate a value from the AdWords data. For example, if you want to increase last year's click values by 10%, you'd set modifierForOldMetric=1.1 for the metric Clicks. If you don't understand what this means, simply leave it at 1 so your reports will include the exact data that comes from AdWords.
  • CALCULATEDMETRICS: This is a list of objects for metrics to include in the report that are ratios, e.g. Ctr. You can also include a set of static values which is useful if you want your charts to include your target as a line. You can name these metrics anything you want. If the metric is a ratio, e.g. CTR, set type to 'ratio' and 'formula' to the division of metrics. These metrics have to be included in the METRICS section. For a static value, set 'type' to static and 'formula' to the static number. We've already included the metrics you'll most likely want in the sample script.
  • CHARTMETRICS: This tells the script which metrics and calculatedmetrics to show in charts. The name has to match one of your choices in METRICS or CALCULATEDMETRICS. If you set includeComparison to 1, then the chart will also include a line for the previous time period
  • AGGREGATESTATSBYLABEL: This tells the script to either total all the metrics by label or to report on every element individually. So for example, if you have 2 campaigns labeled 'Widgets' and you set AGGREGATESTATSBYLABEL to 1, then the output will combine the stats for these 2 campaigns. If on the other hand you set AGGREGATESTATSBYLABEL to 0, it will report stats for each of the two campaigns separately.
  • THOUSANDSSEPARATOR: This tells the script how you display currency in your AdWords account and whether you use a period or comma between thousands. For example, in the US we say $1,000.22 so the value should be "," whereas in Europe you say $1.000,22 so the value for this should be "."
  • INCLUDETOTALS: Tell the script if you want to aggregate all the data from all the labels and include it on its own tab in the Google Sheet. Set to 1 to include the aggregate totals or 0 to NOT include them
  • CHARTWIDTH: This tells the script the width in pixels of every chart
  • CHARTHEIGHT: This tells the script the height in pixels of every chart

Download Script

  • 818Rizzo

    I am receiving an error when trying to use this script:

    One of the conditions in the query is invalid. (line 593)
    I am unsure on how to fix this issue, please advise on how to go about fixing this.

  • http://www.manuelecaddeo.net/ Manuele Caddeo

    Me too i have a problem...

    first: if i give a labels at merchant campaign the script doens't work, error runtime
    second: only labels in search campaign, the log file show this:

    chartStartCol: 1 chartStartRow: NaN

    Cannot convert NaN to (class). (line 489)
    Cannot convert NaN to (class). (line 489)

  • http://www.toptiertools.com/ Frederick Vallaeys

    I just tested my script with Shopping and PLA campaigns and those don't work. It looks like these types of campaigns are not yet supported by Scripts. As soon as Google adds support, we will too.

    • Elena

      Hello. I am getting the same error. Could you please provide with the fixed solution?

  • Elias

    Column 'TotalConvValue' is not valid for report type CAMPAIGN_PERFORMANCE_REPORT. Double-check your SELECT clause. (line 595) - what to do?

    • optmyzr.com

      Thanks for the heads up! Google changed the way they name this field. I've now fixed it so the script uses the correct name. Let us know if it's still not working.

      • Elena

        Hello. I am getting the same error. Could you please provide with the fixed solution?

        • optmyzr.com

          Hi Elena,

          I'm working on a fix. Thanks for reporting this!

          Frederick

  • Terraki

    Hi,
    i would like to compare the last weeks with to the same weeks in the previous year in stead of the precedent weeks, how should i do ?

    • optmyzr.com

      I believe that if you set STARTDAYSAGO to 2 years back (730 days), it should compare week 1 of 2013 to week 1 of 2014. If that's not what's happening, please let me know.