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 script produces Impressions-weighed Quality Score report in G-sheet for Top X Ad Groups, | |
paired with key performance metrics | |
Report is based on Historical Quality Score records | |
Script uses three custom user defined slots for Quality Score: Low, Mid and High | |
*/ | |
// Options section: |
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
// cunstom function | |
function () { | |
var divList = document.querySelectorAll('.bx-soa-section-content div') | |
var content = Array.prototype.reduce.call(divList, function(res, el, ind) {if (el.innerText != '') { var s = el.innerText.split(/\:\s*/); res['field_'+ind] = s[1];} ; return res }, {} ) | |
return content['field_1'] // chose other index for the necessary field | |
} | |
// dataLayer | |
var divList = document.querySelectorAll('.bx-soa-section-content div') |
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
/* | |
Disapproved Extensions Report Script. | |
This scripts generates an email if there are some non-removed disapproved extensions. | |
Disapproval reasons are taken from PLACEHOLDER_FEED_ITEM_REPORT. | |
Check the nameMapping veriable below for the list of supported extensions. | |
Email message could also include a long list of dissaproved remarketing feed items, so adjust settings to skip this if necessary. | |
Developed by Dmytro Bulakh, 2020, [email protected] | |
*/ |
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
/* | |
Sample script to be used as a webhook listener for Google Ads Leads Campaigns | |
## Setup: | |
1) Create a new script project at https://script.google.com/ and paste the script code into the editor window | |
2) Create a new scpreadsheet and paste the URL in lines #15 and #65 | |
3) in the menu above select Init function and make a first run to initialize authorization process (https://nimb.ws/WnvXJz) | |
4) publish the script as a web app through the `Publish > Deply as a web app` menu. Make sure set | |
the "Who has access to the app:" option to "Anyone, even anonymous" | |
5) use generated link as a webhook URL in Google Ads form settings |
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 report2Set(query, idKey, optArgs) { | |
var reg = /SELECT\s+(.+)\s+FROM.*/ | |
var list = query.match(reg) | |
if (!list && !list[1]) throw 'Error parsing parameters from %q'.replace('%q', query) | |
list = list[1].replace(/\s+/, '').split(',') | |
if (list.length < 1) throw 'Error parsing parameters from %q'.replace('%q', query) | |
if (typeof idKey == 'string') { | |
if (!idKey.match(/id/i)) throw 'Bad idKey argument %id'.replace('%id', idKey) | |
if (list.indexOf(idKey) == -1) throw '%id not founf in %q parameters'.replace('%q', query).replace('%id', idKey) | |
} |
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 budgetOrderIterator = AdWordsApp.budgetOrders() | |
.withCondition("Status = ACTIVE") | |
.get(); | |
while (budgetOrderIterator.hasNext()) { | |
var budget = budgetOrderIterator.next(); | |
Logger.log('getName %s, getSpendingLimit %s, getStartDateTime %s', | |
budget.getName(), budget.getSpendingLimit(), budget.getStartDateTime()) | |
} | |
var available = budget.getSpendingLimit() |
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
var plain = { | |
'data.analytics.name': 'coehn', | |
'data.analytics.role': 'ninja' | |
} | |
var converted = function (plainObj) { | |
var converted = {} | |
for (var plainKey in plainObj) { | |
var nextStep = converted | |
var splitted = plainKey.split('.') |
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
var someArray = [] | |
someArray.push = function (element){ | |
//Do what you want here... | |
if (element) { | |
console.log (element) | |
} | |
return Array.prototype.push.apply(this,arguments); | |
} |
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
//Options setcion | |
var OPTIONS = { | |
'REPORT_URL': '', // url of existing report sheet. leave empty string to create new report when script runs | |
'LOOKBACK': '', // optional lookback for items selectors that picks non removed items in loookback period. Defolts to 'LAST_7_DAYS' | |
'EXTENSIONS': ['sitelinks', 'callouts', 'snippets'], // list of extnesions to check. Defaults to ['sitelinks', 'callouts', 'snippets', 'phoneNumbers'] | |
'FORCE_CHECK': true // If true will report if adgroup doesn't contain particular extension but it's available at campaign level. Defaults to false | |
} | |
function getOptions () { | |
var options = {} |
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 myFunction() { | |
try { | |
var message = '' | |
var response = TagManager.Accounts.list() | |
response.account.map(function(account) { | |
Logger.log('fetching changes for %s', account.name) | |
var containers = TagManager.Accounts.Containers.list(account.path) | |
Utilities.sleep(5000) | |
if (!containers.container) { | |
Logger.log('no containers for %s', account.name) |
NewerOlder