AdWords
6.1K members online now
6.1K 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

Email Daily Campaign Spend Report Script

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 
I was helped with the following script that does a neat job of creating a new tab each day for individual campaign spend data.
 
Now, I want the campaign spends to be emailed daily to a set of email ids given much like the Account Summary report shown below but with the campaign names:
 
 How is this possible? The original code that writes the data on to a trix is given below  : 
 
var spreadsheetUrl = "URL"; 
function main() {
 var date = new Date();
 var today = Utilities.formatDate(date, 'PST', 'yyyyMMdd'); 
  var query = "SELECT CampaignName, Cost, Date FROM CAMPAIGN_PERFORMANCE_REPORT DURING YESTERDAY";
 var rows = AdWordsApp.report(query).rows();
 var spreadsheet = SpreadsheetApp.openByUrl(spreadsheetUrl);
 var sheet = spreadsheet.insertSheet(today);
sheet.appendRow(['CampaignName', 'Cost', 'Date']);
 while(rows.hasNext()) {
   var row = rows.next();
   sheet.appendRow([row['CampaignName'], row['Cost'], row['Date']]);
 }
}
 
Please help! Will really appreciate it.
1 Expert replyverified_user

Re: Email Daily Campaign Spend Report Script

Top Contributor
# 2
Top Contributor
Hi Anuraagk,

While we definitely have some scripts wizards here, there is a dedicated forum for Scripts here: https://groups.google.com/forum/#!forum/adwords-scripts - There are numerous threads and examples throughout - I would suggest you head over there as well.

-Tommy
Tommy Sands, AdWords Top Contributor | Community Profile | Twitter | Philly Marketing Labs
Did you find any helpful responses or answers to your query? If yes, please mark it as the ‘Best Answer.’