Skip to content

Instantly share code, notes, and snippets.

2011 - Blue Corona - Analytics Intern - $10/hr
2012 - UMD - Marketing Intern - $10/hr
2012 - BSD - Analytics Architect - $37,000
2013 - BSD - Analytics Architect - $45,000
2014 - BSD - Analytics Architect - $50,000
2015 - Viget - Digital Analyst - $65,000
2016 - Viget - Digital Analyst - $70,000
2017 - Viget - Digital Analyst - $74,000
2018 - Viget - Digital Analyst - $80,000
2019 - Viget - Digital Analyst - $82,000
@awavering
awavering / Wordpress_Recommended_Robots.txt
Created January 10, 2019 20:26
For details on why this is so minimal, see the Yoast blog post at https://yoast.com/wordpress-robots-txt-example/
<!-- Place in head of website -->
<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="{Site Name}">
<meta itemprop="description" content="{Description}">
<meta itemprop="image" content="{Site logo - URL}">
<!-- Twitter Card data -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="{Site Name}">
@awavering
awavering / GA Strip UTM Parameters
Last active August 29, 2015 14:23
Removes UTM parameters from the url after a successful pageview call, reducing the likelihood of polluted referral information.
ga('send', 'pageview', {
'hitCallback': function() {
if (history.replaceState) {
window.history.replaceState('utm', document.title, window.location.pathname);
}
}
});
@awavering
awavering / GA Plugin Demo
Last active August 29, 2015 14:22
A skeleton for building Google Analytics plugins with correct tracker names
// Provides a plugin name and constructor function to analytics.js. This
// function works even if the site has customized the ga global identifier.
function providePlugin(pluginName, pluginConstructor) {
var ga = window[window['GoogleAnalyticsObject'] || 'ga'];
if (ga) ga('provide', pluginName, pluginConstructor);
}
// Plugin constructor.
// All plugin functionality takes place inside the function .
function Demo(tracker, config) {
/* Monthly First Read Data */
SET @year = 2015;
/* $ this Month, Donations this Month, Average Gift This Month */
CREATE TEMPORARY TABLE {{tmp("monthly_stats")}}
select MONTH(cac.transaction_dt) as "month", SUM(cac.transaction_amt) as "revenue", COUNT(cac.transaction_amt) as "count", AVG(cac.transaction_amt) as "average"
FROM cons_action_contribution cac
WHERE YEAR(cac.transaction_dt)=@year AND cac.contribution_type=1 AND cac.transaction_amt>1 AND cac.transaction_amt<9999
GROUP BY MONTH(cac.transaction_dt);
@awavering
awavering / bsd_gai.js
Last active August 29, 2015 14:14
Google Analytics Integration
<!-- START Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<!--place id here-->', 'auto', {'allowLinker': true, 'siteSpeedSampleRate': 20});
ga('require', 'linker');
//See https://github.com/bluestatedigital/bsd-google-analytics-integration#configuration for configuration options
var ga_integration_config={};
@awavering
awavering / bsdstaffquiz
Created December 16, 2014 22:37
BSD Faces - Quiz Mode
//Helpers
//Random integer in range
function random_int(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
//Get employee count
var employee_count = $("#count").text().split(" ")[0];
//Get all employee names
@awavering
awavering / BSD Team Page Scraper.js
Created May 12, 2014 17:01
BSD Team Page Scraper
var bsd=[];
$("article.headshot").each(function(){
var name = $("h4:first",this).text()
var email = $("a", this).text()+"bluestatedigital.com";
var city = $("h5:last", this).text();
var title = $("h5:first", this).text().replace(/\n/g," ");
var image = $("img", this).attr("src");
var team = null;
if(title.match(/Team/) || (title.match(/\,/) && !title.match(/(NY|DC|LA|UK|SF)$/) ) ) {