Thursday, 7 April 2016

AdWords API Scripts - Tracking campaign expenditure with Google Sheets

Hi all,

I am trying to do some basic scripting here, I wish to track daily expenditure for a subset of my AdWords campaigns and log this into a Google Spreadsheet. From there, I will set up budget monitoring which will update daily so i can adjust (for overspend/underspend). I am using a script created by Google Adwords team which I am trying to modify bud here's the problem:

>> Where can I find the reference to field names in the API? ('Clicks', 'Impressions', 'AveragePosition', ...)

Here is the part of the script which is bugging me: 

while (date.getTime() <= yesterday.getTime()) {
    var row = getReportRowForDate(date);
    rows.push([
      new Date(date), 
      row['Cost'], 
      row['AverageCpc'], 
      row['Ctr'],
      row['AveragePosition'], 
      row['Impressions'], 
      row['Clicks']
      ]);
    spreadsheet.getRangeByName('last_check').setValue(date);
    date.setDate(date.getDate() + 1);
  }

I am interested in some of these fields but I cant some other as well.

Many thanks!

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/b67d5f6c-0278-4a6f-8244-be9c8f56b287%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment