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 intercomTagger() { | |
// Make it your own | |
var target = "contacts"; // set to either "contacts" or "companies" | |
var desiredTag = "Test failure tag"; // e.g., "New Tag 1". Tag name must match exactly. | |
// If target is companies and the tag name doesn't exist, a new tag will be created | |
// If target is contacts and the tag name doesn't exist, the task will fail with an explanation | |
var segmentId = ""; // e.g., "5c1d18fddf74c998cb0a9dcd" get this from the URL while viewing a segment | |
var ownerEmail = ""; // email address to notify of errors and optional script results | |
var sendResultEmails = true; // true or false -- do you want to be notified every time the script runs? |
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
javascript:(function() { | |
var refTable = location.pathname.split('/')[1]; | |
var source = initData.lastTableIdsUsedByApplicationId; | |
var apps = Object.keys(source); | |
var tables = Object.values(source); | |
for (var i = 0; i < tables.length; i++) { | |
if (tables[i] === refTable) { | |
var j = i; | |
i = tables.length; |
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 getBaseUsers() { | |
var options = { | |
"contentType" : "application/json", | |
"headers" : { | |
"Accept": "application/json", | |
"Authorization": "Bearer <TOKEN>" | |
} | |
} | |
var response = UrlFetchApp.fetch("https://api.getbase.com/v2/users", options); | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); |
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 getAsanaUsers() { | |
var options = { | |
"headers" : { | |
"Authorization": "Bearer <TOKEN>" | |
} | |
} | |
var response = UrlFetchApp.fetch("https://app.asana.com/api/1.0/workspaces/<workspace-id>/users", options); | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheets = ss.getSheets(); |
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 getId() { | |
/** | |
* Imported from https://github.com/kyo-ago/UUID | |
* Robbie Mitchell, @superstrong | |
*/ | |
/** | |
* UUID.core.js: The minimal subset of the RFC-compliant UUID generator UUID.js. | |
* | |
* @fileOverview |
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
userId is a better way to join data at the user level across various tracking/email/etc. services. Why? | |
- UserId is stable (e.g., update a user's email address from anywhere by calling Segment identify with the same userId.) | |
- UserId is not PII (e.g., Google Analytics explicitly forbids using PII as a userId) | |
So, in addition to manually adding a subscriber to your Mailchimp list, this will explicitly assign a userId to each new subscriber and identify the user via Segment. | |
Quick steps: | |
- Get your Mailchimp list embed code here: Lists -> {list} -> Signup forms -> Embedded forms | |
- Use it to replace the three values in the "action" line below with your own. Also change "us6" if yours is different. | |
- In the hidden input field with id "bot-field", replace the name with the one from your own embed code. |
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
This code is for a website that collects email addresses but no registrations (e.g., passwords, etc.). The requirements for the project go further, but this is a necessary first step. | |
Project requirements: | |
- Simplify tracking implementation | |
- Use a userId, not email address, as primary key | |
- Avoid using a database on email-only website | |
Segment is useful as a canonical tracker -- a single place to track identity, pageviews. It works best, though, when a server generates a userId and calls `identify`, ensuring the userId passed through to all connected services. | |
Here, in lieu of a server-generated userId, we check for a Segment userId in the cookie. If it exists, we use it. If it doesn't, we grab Segment's anonymousId and re-use it as userId. This, along with the other form fields in a simple form, are used in an `identify` call that ensures all connected services get the same userId. |
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
// Example use in a cell: "=map(90210)" (without quotes) | |
// Example output: "Beverly Hills, CA 90210" | |
function map(zip_code) { | |
// Make HTTP Request | |
var url = 'http://api.zippopotam.us/us/' + zip_code; | |
var response = UrlFetchApp.fetch(url); | |
var json = response.getContentText(); | |
var data = JSON.parse(json); |
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
<html> | |
<head> | |
<title>{{ content.html_title }}</title> | |
<meta name="description" content="{{ content.meta_description }}"/> | |
<meta name="robots" content="noindex"> | |
<style> | |
.spinner { | |
position: fixed; | |
top: 50%; | |
left: 50%; |
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
javascript:window.location="https://gmail.com/#search/rfc822msgid:"+encodeURIComponent(window.document.body.innerHTML.match(/Message-ID: <(.*)>/)[1])+"/"+encodeURIComponent(window.location.search.toString().slice(1).split('&').filter(function(x){return x.slice(0,3) == "th="})[0].slice(3)); |
NewerOlder