Hello, obviously I didn't write this but I want to modify it to make it work, it's supposed to pause Keywords with a lower QS than 6
Hello, I found a nice script that I wanted to update to work with the current Adwords API.
I updated two things on this script before posting, changing "Keyword" to Criteria (it was reporting an error on line 31 before I did this
And changing "Active" to "Enabled" it was reporting an error before changing this.
Yet this script is lacking something. It's supposed to pause keywords that have a lower QS than 6 but I don't see a pause command, I tested it with KW that have 5 or lower score and it does email me a google spreadsheet with those keywords but it doesn't pause them.
Am I missing something?
Thanks!
// Copyright
www.optmyzr.com all rights reserved. This script is provided on a as-is basis with no guarantee.
// This script may be distributed freely, without changing this notice
function main() {
//EDIT- SECTION
//Enter email address. For mulitple addresses please enter the the addresses separated by a comma.
//Change the pause value to true to pause the keywords with below quality score.
var pause = true;
//This quality score defines the threshold to find keywords below it.
var quality_score = 6;
//ENTER the number of days you would like to get the stats of keywords for. By default it checks for last 30 days.
var date_range = "LAST_30_DAYS";
//END OF EDIT-SECTION
var workbook = SpreadsheetApp.create("Keywords with low Quality Score (" +
Utilities.formatDate(new Date(), "PST", "MM-dd HH:mm)"));
var currentSheet = workbook.getActiveSheet();
var keyword_found=false;
currentSheet.setName("Overview");
currentSheet.appendRow(["Campaign Name","Adgroup","Criteria","Cost","Impressions","Conversions","Quality Score"]);
currentSheet.getRange("1:1").setFontWeight("bold");
var report = AdWordsApp.report("SELECT CampaignName, AdGroupName, Criteria, Cost, Impressions, Conversions, QualityScore "+
"FROM KEYWORDS_PERFORMANCE_REPORT "+
"WHERE CampaignStatus= ENABLED and AdGroupStatus = ENABLED and Status = ENABLED and QualityScore<"+quality_score+
" DURING "+date_range);
report.exportToSheet(currentSheet);
var rows = report.rows();
if(!rows.hasNext()){
currentSheet.appendRow(["No active Keywords Found"]);
}
MailApp.sendEmail(email_address, "Quality Score Tracker for Keywords", "You can see the keywords on the following url\n\n"+workbook.getUrl());
}