Automated Account Performance Reporting to a Google Sheet

127 views
Skip to first unread message

Scott Trevellyan

unread,
Mar 1, 2017, 2:09:56 PM3/1/17
to AdWords Scripts Forum
Hello Team,

Thank you so much in advance for your help. 

I am new to using Google AdWords scripts and was wondering if anyone has come across a script to automate the export of daily performance stats at the account level to a particular Google Sheet tab? 

The columns would ideally include: 
Day    
Clicks    
Impressions    
Avg. CPC    
CTR    Avg. position    
Cost    
Converted clicks    
Cost / converted click 

I have attached a screen shot of what I mean. 

Thanks again, 

Scott



Screenshot (3).png

Anthony Madrigal

unread,
Mar 1, 2017, 2:18:03 PM3/1/17
to AdWords Scripts Forum
Hi Scott,

You can create an Account Performance Report to export on a spreadsheet by following this code

Alternatively, you can also use our Account Summary Report solution script. 

Cheers,
Anthony
AdWords Scripts Team

Scott Trevellyan

unread,
Mar 1, 2017, 5:02:26 PM3/1/17
to AdWords Scripts Forum
HI Anthony, 

Thank you for your response. 

After adding the script code to AdWords and after adding in the spreadsheet URL, I am receiving the following error: Missing ) after argument list. (line 51)

It looks like there is a close parentheses already. Am I missing something?

Thanks, 

Scott
Screenshot (5).png

Anthony Madrigal

unread,
Mar 1, 2017, 5:06:59 PM3/1/17
to AdWords Scripts Forum
Hey Scott,

You can leave line 51 untouched
Logger.log('Using spreadsheet - %s.', SPREADSHEET_URL);

You only need to specify your spreadsheet URL in line 40. This should resolve your issue.

Scott Trevellyan

unread,
Mar 1, 2017, 7:26:35 PM3/1/17
to AdWords Scripts Forum
Thanks Anthony, that fixed the issue. If I wanted to add conversions and cost per conversion as additional metrics, would I just add them in the script with the others?
Screenshot (6).png

Scott Trevellyan

unread,
Mar 1, 2017, 7:27:29 PM3/1/17
to AdWords Scripts Forum
(row 65 was where I added the metrics)

Anthony Madrigal

unread,
Mar 2, 2017, 10:54:48 AM3/2/17
to AdWords Scripts Forum
Hi Scott,

There are a couple things you need to change. 
  • Row 65 as you mentioned
  • Adding the columns of the fields you want in your spreadsheet
  • Adding the fields to the report query on line 182
When adding the fields in the script itself (65 and 182), you will need to use Conversions and CostPerConversion. You can see all the available fields listed here. The fields should be as they are displayed on the left column.

Scott Trevellyan

unread,
Mar 2, 2017, 11:59:12 AM3/2/17
to AdWords Scripts Forum
HI Anthony, 

Thank you sooo much. That is so helpful and worked perfectly. 

Best, 

Scott

Scott Trevellyan

unread,
Mar 7, 2017, 5:05:59 PM3/7/17
to AdWords Scripts Forum
HI Anthony, 

I had another quick question.  Currently, when the report export script exports a new day's row of statistics, it includes the 6 digit time of day subsequent to the date in column B. Which line of code would I change to remove the time from that column export?

Thank you, 

Scott

Anthony Madrigal

unread,
Mar 8, 2017, 9:55:54 AM3/8/17
to AdWords Scripts Forum
Hi Scott,

The time was included there since it was necessary fix that resolves issues dealing with timezone bugs for v 1.0.1 and 1.0.2.

Regards,
Anthony
AdWords Scripts Team

Scott Trevellyan

unread,
Mar 8, 2017, 12:58:43 PM3/8/17
to AdWords Scripts Forum
Ah, I see. Thank you anyway!
Reply all
Reply to author
Forward
0 new messages