Skip to content

Instantly share code, notes, and snippets.

@philbar
philbar / gist:880285d3655981c94b84
Last active August 29, 2015 14:11
geolocation.html
<script type="text/javascript" src="//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js"></script>
<script type="text/javascript">
var onSuccess = function(location){
vLat = location.location.latitude;
vLon = location.location.longitude;
vCty = location.city.names.en;
vCon = location.city.confidence;
@philbar
philbar / adwords-script.js
Created June 12, 2014 19:54
Track AdWords Quality Score with Google Analytics
***********************************************
*v. 1.6 updated 02062014
* Credits:
* Alexey Chesnok google.com/+AlexeyChesnok
* Based on:
* Quality score calculator by Frederick Vallaeys at Optmyzr
* http://www.optmyzr.com/scripts Buy his Scripts, they are awesome!
* License http://creativecommons.org/licenses/by-nc/4.0/deed.en_US
* and google analytics beacon by Russell Savage
* http://www.freeadwordsscripts.com/2013/11/track-adwords-script-runs-with-google.html
<script>
function controlVariant() {
dataLayer.push({'event': 'google'});
return variantOne;
}
function testVariant() {
dataLayer.push({'event': 'adroll'});
return variantTwo;
}
/*********************************************
* Automated Creative Testing With Statistical Significance
* Version 2.0
* Changelog v2.0
* - Fixed bug in setting the correct date
* - Script now uses a minimum visitors threshold
* per Ad instead of AdGroup
* - Added the ability to add the start date as a label to AdGroups
* - Added ability to check mobile and desktop ads separately
* Changelog v1.1.1 - Fixed bug with getDisplayUrl
@philbar
philbar / AdWords_Scripts_Ad_Testing.js
Last active August 29, 2015 14:00 — forked from russorat/AdWords_Scripts_Ad_Testing.js
Replace Visitor Threshold with Chi-Squared test
/*********************************************
* Automated Creative Testing With Statistical Significance
* Version 2.1
* Changelog v2.1 - Replace Visitor Threshold with Chi-Squared test
* Changelog v2.0
* - Fixed bug in setting the correct date
* - Script now uses a minimum visitors threshold
* per Ad instead of AdGroup
* - Added the ability to add the start date as a label to AdGroups
* - Added ability to check mobile and desktop ads separately