Skip to content

Instantly share code, notes, and snippets.

View dnalob's full-sized avatar
🎯
Focusing

dnalob

🎯
Focusing
View GitHub Profile
@dnalob
dnalob / find-cell-value-and-delete-row.js
Created December 27, 2019 03:56 — forked from dDondero/find-cell-value-and-delete-row.js
Google Apps script function to delete rows based on value in cell.
function deleteRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
var values = rows.getValues();
var rowsDeleted = 0;
for (var i = 0; i <= numRows - 1; i++) {
var row = values[i];
if (row[0] == 'delete' || row[0] == '') { // This searches all cells in columns A (change to row[1] for columns B and so on) and deletes row if cell is empty or has value 'delete'.
@dnalob
dnalob / text-to-columns.js
Created December 27, 2019 04:00 — forked from dDondero/text-to-columns.js
Miss text to columns functionality (ex. .csv file to rows) in Google Apps. Here is a script that creates an extra menu with a few useful functions. Published by Evan Plaice on StackExchange. I share it here because it was very useful to me and hopefully more will find it.
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [];
menuEntries.push({ name:"Text to columns", functionName:"textToColumns" });
menuEntries.push({ name:"Text to columns (custom separator)", functionName:"textToColumnsCustom" });
menuEntries.push(null);
menuEntries.push({ name:"Columns to Text", functionName:"columnsToText" });
menuEntries.push({ name:"Columns to Text (custom separator)", functionName:"columnsToTextCustom" });
ss.addMenu("Advanced", menuEntries);
}
@dnalob
dnalob / macro.gs
Created December 27, 2019 04:06 — forked from bran921007/macro.gs
A lot of macro script samples (Format text, Convert all formulas to valus in sheet, Sort sheets alphabetically, unhide all rows and collumns, reset filter, etc)
// 3. Format Text Example
function FormatText() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getActiveRangeList().setFontWeight('bold')
.setFontStyle('italic')
.setFontColor('#ff0000')
.setFontSize(18)
.setFontFamily('Montserrat');
};
@dnalob
dnalob / Scrape YouTube search Results
Created January 7, 2020 00:12 — forked from erajanraja24/Scrape YouTube search Results
Scrape YouTube Search Results
function YouTubeScraper() {
var sh1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
var keyword = sh1.getRange("B1").getValue();
var results = YouTube.Search.list('id,snippet', {q:keyword, maxResults:50});
//Video ID Published Date Channel ID "Video Title
//" Description Thumbnail URL Channel Title
var items = results.items.map(function(e){
return [e.id.videoId,
e.snippet.publishedAt,
/***********************************************************************************************
* AdWords Account Optimization - Review Google Display Network Site Placement Quality.
* Analyze Display Network Placements that have accrued more than $20 of cost MTD against
* Standard SEO metrics (PageAuthority, DomainAuthority, # of Backlinks, Age of Site) and report back
* Any questionable placements that are strong targets for exclusion.
* Created By: Derek Martin
* DerekMartinLA.com
****************************************************************************************/
// CONSTANTS
@dnalob
dnalob / gdn-placement-analysis
Created January 10, 2020 23:09 — forked from derekmartinla/gdn-placement-analysis
Find Underperforming Placements & Opportunities On Google Display Network
// This script reviews your GDN placements for the following conditions:
// 1) Placements that are converting at less than $40
// 2) Placements that have cost more than $50 but haven't converted
// 3) Placements that have more than 5K impressions and less than .10 CTR
function main() {
var body = "<h2>Google Display Network Alert</h2>";
body += "<h3>Placements that are converting at less than $40:</h3> " ;
body += "<ul>";
@dnalob
dnalob / Exclude Mobile App Placements
Created January 14, 2020 03:10 — forked from siliconvallaeys/Exclude Mobile App Placements
Add poorly performing mobile app placements on GDN as excluded targets
/****************************
* Exclude Mobile App ad placements that perform poorly
* Version 1.0 (Aug 08, 2018)
*
* Created By: Optmyzr
* A supported version of this script is available at www.optmyzr.com
****************************/
function main() {
@dnalob
dnalob / Exclude Google Display Placements That Contain ...
Created January 14, 2020 03:12 — forked from siliconvallaeys/Exclude Google Display Placements That Contain ...
Automatically add negative placements for any new automatic GDN placements that include a particular piece of text
/****************************
* Add a Placement Exclusion When an Automatic Placement Contains the Text ...
* Version 1.0
*
* Created By: Frederick Vallaeys
* for FreeAdWordsScripts.com
* at the request of an Optmyzr.com subscriber
****************************/
function main() {
@dnalob
dnalob / Expanded Text Ad Suggestor.js
Created January 14, 2020 03:15 — forked from siliconvallaeys/Expanded Text Ad Suggestor.js
Generate an AdWords bulksheet with suggestions for expanded text ads based on your landing page meta data
// Generate Expanded Text Ads From Landing Page Meta Data - AdWords Script
//
// Copyright 2016 - Optmyzr Inc - All Rights Reserved
// For more AdWords Scripts and PPC Management Tools and Reports, visit
//
// https://www.optmyzr.com/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Limit Monthly Cost By Postal Codes in a Campaign
//
// Copyright 2017 - Optmyzr Inc - All Rights Reserved
// Visit www.optmyzr.com for more AdWords Scripts and PPC Management Tools and Reports
//
//
// Purpose of the script:
// ---------------------
// To allow you to set a broad location target to capture more traffic in a regionwhile at the same time
// letting you limit the monthly cost for locations within the target region.