This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************* | |
* Automatically adds any new keywords in your | |
* Alpha campaigns as exact match negatives in | |
* the corresponding Beta campaign. Also handles | |
* pausing or removing keywords in your Alpha campaign | |
* and removing the corresponding negative in your Beta. | |
*******************************/ | |
// Just as before, these strings will be | |
// used to identify your Alpha and Beta campaigns. | |
// This script assumes that your Alpha campaigns are |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****************************************** | |
* Monitor Broken Links Using MCC Level Scripts | |
* Version 1.5-alt | |
* Changelog v1.5-alt | |
* - Added ability to pause and enable keywords/ads | |
* Changelog v1.4 | |
* - Fixed INVALID_QUERY error | |
* Changelog v1.3 | |
* - Added previous version of report api to script until | |
* I update my urls. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you are running this from a spreadsheet, you can leave this blank and | |
// it will pick up the active spreadsheet. If you are running this from a | |
// new script.google.com project, you should put the url of the google sheet here. | |
var SPREADSHEET_URL = ''; | |
var ES_HOST = { | |
host : '', // for found.io, something.loc.aws.found.io | |
port : 9243, // the port, usually 9200 or 9243 | |
username : '', | |
password : '', | |
use_ssl : true // set to false to use http |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************ | |
* Store Account, Campaign, and AdGroup Level Quality Score | |
* Version 2.3 | |
* ChangeLog v2.3 | |
* - Solved #NUM! issue by filtering out -- values | |
* ChangeLog v2.2 | |
* - Updated KeywordText to Criteria | |
* ChangeLog v2.1 | |
* - Ignore negatives | |
* ChangeLog v2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() { | |
var config_options = { | |
'default' : { | |
metric : 'Conversions', // This metric will be used for determining duds | |
threshold : 0, // Duds are less than or equal to this threshold | |
days_ago : 90, // The timeframe of the data to consider, days ago to yesterday | |
days_in_limbo : 5 // The script will warn you for this many days before deleting something | |
} | |
// If you want, you can add account specific configurations too. If an account specific config | |
// is not found, the default one from above is used. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** | |
* Helper function to create the labels in the account | |
* that will be used to keep track of Keywords in limbo. | |
***********/ | |
function createLabelsIfNeeded(days_in_limbo) { | |
for(var i = 1; i<=days_in_limbo; i++) { | |
var label_name = 'Deleting in '+i+' days'; | |
if(!AdWordsApp.labels().withCondition("Name = '"+label_name+"'").get().hasNext()) { | |
AdWordsApp.createLabel(label_name, | |
'These entities will be deleted in '+i+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** | |
* Find all the keywords that were active daysAgo | |
* Return those Ids in a mapping so we can easily filter other | |
* queries. | |
***********/ | |
function getKeywordsActiveDaysAgo(daysAgo) { | |
// This will be a mapping of Ids we will return | |
var keyword_ids = {}; | |
// We are only concerned with the Ids, so let's | |
// make this as small as possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** | |
* Find all the keywords that match a set of criteria. Those keywords | |
* will be filtered by the set of eligible keywords. | |
* It returns a list of AdGroup and Keyword Ids to use in a Selector. | |
***********/ | |
function getDuds(options,eligible_keywords) { | |
var columns = ['CampaignId', | |
'AdGroupId', | |
'Id']; | |
// Let's add the metric we're using to find the duds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** | |
* Given a set of Ids, an object to store updates in, and the | |
* max number of days a keyword can be in limbo, this function | |
* iterates through your account and gathers the changes to be | |
* made. It also contains the logic to ignore keywords with the | |
* label "Save" on them. All changes are stored in the arrays within | |
* the object changes_to_make. | |
**********/ | |
function findChangesToMake(duds,changes_to_make,max_days_in_limbo) { | |
// This is the label applied to "Save" a keyword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** | |
* This function applies a set of changes provided. | |
* It utilizes tight loops to take advantage of any | |
* batch processing behind the scenes. | |
***********/ | |
function applyChanges(changes_to_make) { | |
for(var i in changes_to_make.kw_to_delete) { | |
changes_to_make.kw_to_delete[i].remove(); | |
} | |
for(var i in changes_to_make.labels_to_delete) { |