AdWords
6.4K members online now
6.4K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Daily Adgroup Report - Google Scripts

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi everybody,

 

i try to create a automated daily adgroup report with google scripts.

 

if possible at a MCC level, if not i could also work with a account level

Date, Adgroupname, Clicks, Cost, Impressions

 

For any reason my created script has errors.

 

function main() {
var spreadsheet = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1EF8ymhhIeYIhWSBILSNYcAnXrN6Zj7OqSWhXS_x9E0M/edit#gid=0');
var query = 'SELECT AdGroupName, Clicks, Cost, Impressions ' +
'ADGROUP_PERFORMANCE_REPORT ' +
'DURING YESTERDAY';
var report = AdWordsApp.report(query);
var sheet = spreadsheet.getActiveSheet();
report.exportToSheet(sheet);
}

 

Can somebody help me?

 

Thanks a lot!

Rockina

 

----------------------

Hallo zusammen, 

 

ich moechte einen automatisierten Report mit Google Scripts erstellen. 

 

Optimalerweisse auf MCC Ebene (Wenn nicht moeglich gerne such einzeln pro Account) - daily

Date, Adgroupname, Clicks, Cost, Impressions

 

Leider scheitere ich bei der Erstellung des Scripts und weiss selber nicht so genau warum: 

 

function main() {
var spreadsheet = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1EF8ymhhIeYIhWSBILSNYcAnXrN6Zj7OqSWhXS_x9E0M/edit#gid=0');
var query = 'SELECT AdGroupName, Clicks, Cost, Impressions ' +
'ADGROUP_PERFORMANCE_REPORT ' +
'DURING YESTERDAY';
var report = AdWordsApp.report(query);
var sheet = spreadsheet.getActiveSheet();
report.exportToSheet(sheet);
}

 

Kann hier wer weiterhelfen? 

 

Danke im Voraus!

Rockina

 

3 Expert replyverified_user

Re: Daily Adgroup Report - Google Scripts

Top Contributor
# 2
Top Contributor

Hi Rockina,

 

What errors are you getting?

 

@Jon_Gritton might assist you with this when he comes in.

 

In the meanwhile you could also try posting this question over the AdWords script forum:- https://groups.google.com/forum/#!forum/adwords-scripts

 

Pankaj

Marked as Best Answer.
Solution
Accepted by topic author Rockina S
April 2016

Re: Daily Adgroup Report - Google Scripts

Rising Star
# 3
Rising Star

Hi @Rockina S

 

You forgot the "from":

var query = 'SELECT AdGroupName, Clicks, Cost, Impressions ' +
'from ADGROUP_PERFORMANCE_REPORT ' +
'DURING YESTERDAY';

Try it and see if you have other errors.

Re: Daily Adgroup Report - Google Scripts

Explorer ✭ ☆ ☆
# 4
Explorer ✭ ☆ ☆

Hello @Rockina S,

 

I will suggest you rather than use script, you can use report tab. It is best for you get exactly all thing which would like

Date, Adgroupname, Clicks, Cost, Impressions

https://support.google.com/adwords/answer/6191545?hl=en

 

You just need to schedule timing and you will get daily report with out  any hard work.

 

but if would like to setup script then please follow this URL:

https://developers.google.com/adwords/api/docs/appendix/reports

 

Mohit

 

Re: Daily Adgroup Report - Google Scripts

Top Contributor
# 5
Top Contributor

Tip for all scripters using Reports:  It's a good idea to build your AWQL query as a separate variable, then fetch the result using that variable, as follows:

 

var query = "SELECT Cost "
  + "FROM CAMPAIGN_PERFORMANCE_REPORT"
  + "DURING LAST_7_DAYS";
var result = AdWordsApp.report(query);

Doing this enables you to log the query you're sending and when queries are built from multiple lines, perhaps using variables, this makes it easy to spot errors.  For example doing so in the above:

var query = "SELECT Cost "
  + "FROM CAMPAIGN_PERFORMANCE_REPORT"
  + "DURING LAST_7_DAYS";
Logger.log(query);
var result = AdWordsApp.report(query);

Would produce the following output:

SELECT Cost FROM CAMPAIGN_PERFORMANCE_REPORTDURING LAST_7_DAYS

so it's easy to spot my deliberate error missing a space.

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

Re: Daily Adgroup Report - Google Scripts

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Thank you, now it's working! Smiley Happy

Re: Daily Adgroup Report - Google Scripts

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Hi Mohit, thank you thats a great Idea an its really easier.
I will use this report in the future Smiley Happy