Hi, I'm afraid please post it to the AdWords Scripts forum<https://groups.google.com/forum/#!forum/adwords-scripts> . This forum is for AdWords API.
Best, - Takeshi, AdWords API Team On Saturday, July 20, 2013 8:18:17 PM UTC+9, Ramarosoa Faneva wrote: > > Hi All, > > I was using the codes of Russ for the QS account, i wanted to include the > variation of cpc too but the codes gives me an apprendRow error. This is my > code : > > //----------------------------------- > // Store Account Level Quality Score in Google Spreadsheet. > // Created By: Russ Savage > // Based on script originally found at: > http://searchengineland.com/how-account-quality-score-can-guide-adwords-optimization-148595 > // FreeAdWordsScripts.com > //----------------------------------- > function main() { > var SPREADSHEET_URL = " > https://docs.google.com/spreadsheet/ccc?key=0AuBDBGZ7z9xYdDEzMDNxOU5MZVltZ2FTMzladHAtN0E#gid=0 > "; > var ACCOUNT_NAME = 'Account1'; > var today = new Date(); > var date_str = [today.getFullYear(),(today.getMonth() + > 1),today.getDate()].join("-"); > > var spreadsheet = getSpreadsheet(SPREADSHEET_URL); > var qs_sheet = spreadsheet.getSheetByName(ACCOUNT_NAME); > > var kw_iter = AdWordsApp.keywords() > .withCondition("Status = ENABLED") > .forDateRange("LAST_30_DAYS") > .withCondition("Impressions > 0") > .orderBy("Impressions DESC") > .withLimit(50000) > .get(); > > var tot_imps_weighted_qs = 0; > var tot_imps = 0; > var tot_cout = 0; > var tot_clics = 0; > > while(kw_iter.hasNext()) { > var kw = kw_iter.next(); > var kw_stats = kw.getStatsFor("LAST_30_DAYS"); > var imps = kw_stats.getImpressions(); > var cout = kw_stats.getCost (); > var clics = kw_stats.getClicks (); > var qs = kw.getQualityScore(); > tot_imps_weighted_qs += (qs * imps); > tot_imps += imps; > tot_cout += cout; > tot_clics += clics; > } > > var acct_qs = tot_imps_weighted_qs / tot_imps; > var couts = tot_cout; > var clicks = tot_clics; > > qs_sheet.appendRow([date_str,acct_qs,couts,clicks]); > > function getSpreadsheet(spreadsheetUrl) { > var matches = new RegExp('key=([^&#]*)').exec(spreadsheetUrl); > if (!matches || !matches[1]) { > throw 'Invalid spreadsheet URL: ' + spreadsheetUrl; > } > var spreadsheetId = matches[1]; > return SpreadsheetApp.openById(spreadsheetId); > } > } > > Someone can help me ? > > Thanks you ! > > > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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+unsubscr...@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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.