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
<script type="text/javascript"> | |
// URL toolbox - helps grabbing elements in the URL | |
var _d = document; | |
var _dl = _d.location; | |
var _dlp = _dl.pathname; | |
var _dls = _dl.search; | |
var _dr = _d.referrer; | |
// Initialize your data layer and start pushing variables from custom WordPress PHP data layer | |
dataLayer.push({ |
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
def answer_door(): | |
print "The doorbell rings and you open the door" | |
print "Is this someone that you know?" | |
answer = raw_input("Answer Yes No or Sketchy.").lower() | |
if answer == "yes": | |
print "Hey friend! How's it going? It's so great to see you again!" | |
elif answer == "no": | |
print "Oh, hello I do not think we've met before. How can I help you?" | |
else: | |
print "It's probably a bill collector! Shut the door!" |
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
function main() { | |
MccApp.accounts().withCondition("Cost > 1.00").forDateRange("YESTERDAY").withLimit(50).executeInParallel('runOnEachAccount', 'finished'); | |
} | |
function runOnEachAccount() { | |
Logger.log('Starting on: '+AdWordsApp.currentAccount().getCustomerId()); | |
var results = getAccountReport(); | |
Logger.log(results); | |
return JSON.stringify(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
/***What should this script do? | |
1. Loop through all of the spreadsheets | |
2. If the row after the row that contains AssociatedCampaignName is blank, Write "Waiting For Spot" in the next row after the cell that contains AssociatedCampaignName, IE: A2 | |
3. Write "#" in B2:H2 | |
**/ | |
function waiting(){ | |
var ss = SpreadsheetApp.getActive(); | |
for(var n in ss.getSheets()){// loop over all tabs in the spreadsheet |
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
//gets Today's date | |
var currentDate = new Date(); | |
//Pulls the date and month parts of the date out. | |
var year = currentDate.getFullYear(); | |
var month = getTwoMonthsAgo(currentDate); | |
//for formatting. | |
month = padTwo(month); |
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 |
OlderNewer