This file contains 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
<script> | |
datalayer = []; | |
</script> |
This file contains 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
def donuts(count): | |
if count >= 10: | |
return 'Number of donuts: many' | |
else: | |
return 'Number of donuts: %s' % count | |
def donuts(count): | |
text1 = 'Number of donuts: ' | |
if count<10: | |
text = text1 + str(count) |
This file contains 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 makeid() | |
{ | |
var text = ""; | |
var possible = "AB"; | |
for( var i=0; i < 1; i++ ) | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
} |
This file contains 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
import argparse | |
import sys | |
from apiclient.errors import HttpError | |
from apiclient import sample_tools | |
from oauth2client.client import AccessTokenRefreshError | |
def main(argv): | |
analytics, flags = sample_tools.init( |
This file contains 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
ad_id <- data %>% group_by(CustomerID, Campaign, Adgroup, AdID) %>% summarize( | |
AverageCpc=round(sum(Cost) / sum(Clicks),2), | |
Clicks=sum(Clicks), | |
Impressions=sum(Impressions), | |
CTR=round(sum(Clicks) / sum(Impressions),2), | |
Cost=round(sum(Cost),2), | |
Conversions=sum(Conversions), | |
CPA=round(sum(Cost) / sum(Conversions),2), | |
ConversionRate=round(sum(Conversions) / sum(Clicks), 2)) | |
ad_id[ad_id==Inf] <- 0 |
This file contains 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 dateRange = "THIS_MONTH"; | |
function main() { | |
MccApp.accounts().withCondition("Cost > 1.00").forDateRange(dateRange).withLimit(50).executeInParallel('runOnEachAccount'); | |
} | |
function runOnEachAccount() { | |
var stats = AdWordsApp.currentAccount().getStatsFor(dateRange); | |
var impressions = stats.getImpressions(); | |
var clicks = stats.getClicks(); | |
var cost = stats.getCost(); |
This file contains 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 SPREADSHEET_URL = "YOUR URL HERE"; | |
function main() { | |
//These names are important. change them with caution | |
var tabs = ['ABC123', 'ABC123 LM']; | |
for(var i in tabs) { | |
var results = runQuery(tabs[i]); | |
writeToSpreadsheet(tabs[i],results); | |
} | |
} |
This file contains 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 dateRange = "THIS_MONTH"; | |
function main() { | |
MccApp.accounts().withCondition("Cost > 1.00").forDateRange(dateRange).withLimit(50).executeInParallel('runOnEachAccount'); | |
} | |
function runOnEachAccount() { | |
var stats = AdWordsApp.currentAccount().getStatsFor(dateRange); | |
var impressions = stats.getImpressions(); | |
var clicks = stats.getClicks(); | |
var cost = stats.getCost(); |
This file contains 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 onEdit(e) { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var name = sheet.getName(); | |
var cell = sheet.getActiveCell(); | |
var value = cell.getValue(); | |
if (typeof value == 'string') { | |
var spanish = LanguageApp.translate(value, 'en', 'es'); | |
cell.setValue(spanish); | |
} | |
} |
This file contains 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 dateRange = "THIS_MONTH"; | |
var SPREADSHEET_URL = "url"; | |
var accounts = []; | |
var values = []; | |
function main() { | |
var ss = SpreadsheetApp.openByUrl(SPREADSHEET_URL); | |
var clear = ss.getSheetByName('Adwords').getRange("A2:C").clear(); | |
var sheet = ss.getSheetByName('Accounts'); | |
var name = sheet.getName(); |
OlderNewer