Skip to content

Instantly share code, notes, and snippets.

@simondahla
simondahla / deviceOrientationForGTM.js
Last active October 18, 2018 13:30
Device Orientation Detection for Google Analytics. Modded version for Google Tag Manager (GTM). Originally from https://www.themarketingtechnologist.co/using-html5s-device-orientation-to-track-device-behaviour/
/**
* isMobile.js v0.4.0
*
* A simple library to detect Apple phones and tablets,
* Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone),
* and any kind of seven inch device, via user agent sniffing.
*
* @author: Kai Mallea (kmallea@gmail.com)
*
* @license: http://creativecommons.org/publicdomain/zero/1.0/
@simondahla
simondahla / gtm-noindex-tag.html
Last active November 6, 2015 08:19
If running an split test (AB-test redirecting the traffic to different pages) use this to exclude the variation(s) so you don't get punished for duplicate content. This should work in the same way as described in this blog post: http://dah.la/1RAIrzJ
<script>
var m = document.createElement('meta');
m.name = 'robots';
m.content = 'noindex, nofollow';
document.head.appendChild(m);
</script>
#templatePreheader{
background-color:#e61c1c;
border-top:0;
border-bottom:0;
}
.preheaderContainer .mcnTextContent,.preheaderContainer .mcnTextContent p{
color:#fefefe;
font-family:Helvetica;
font-size:9px;
line-height:100%;
$(function() {
var experimentID = optimizely.data.state.activeExperiments[0];
var experimentName = experimentID;
if (typeof optimizely.data.experiments[experimentID] !== 'undefined') {
experimentName = optimizely.data.experiments[experimentID].name;
}
var variationName = optimizely.data.state.variationNamesMap[experimentID];
$(function() {
var experimentID = optimizely.data.state.activeExperiments[0];
var experimentName = experimentID;
if (typeof optimizely.data.experiments[experimentID] !== 'undefined') {
experimentName = optimizely.data.experiments[experimentID].name;
}
var variationName = optimizely.data.state.variationNamesMap[experimentID];
(function() {
var url = window.location.host;
if(window.location.pathname === ""){
url = window.location.host + "/" + window.location.pathname;
}
function trackField(){

AB-test workflow

These instructions describes an AB-test development for OSX

##Dependencies & Instructions

  1. Install Homebrew through your command line ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install master/install)"

  2. Install Git via Homebrew. Run brew install git in your command line.

Since we have observed that [problem description]
by [data/observation method]
we want to [make this change]
which should lead to [desired change in behavior]
The effect will be measured by [KPI(s) or metrics that will change]

@simondahla
simondahla / pageres_README.md
Last active August 29, 2015 14:06
Document your work, changes – Capture screenshots of websites in various resolutions.

Document your work and changes! – Capture screenshots of websites in various resolutions.

  1. Install Pageres via npm install --global pageres-cli
  2. Download the textfile (above) with the most poplular screen resolutions and put it the desired folder OR go in to your Google Analytics account and grab the most popular screen resolutions for your site
  3. Run pageres example.com --crop &lt; res.txt and you will have a bunch of screenshots of your site.
@simondahla
simondahla / increase-tracked-clicks-vwo-heatmaps.html
Last active August 29, 2015 14:06
You can increase the number of clicks for a session to be used for mapping heatmaps and clickmaps. The default is number is 3. If you want to record more clicks from a session, let's say: you wish to increase the number of clicks to 10 (or any number), then define the following java script variable above VWO tracking code. Read more about VWO He…
<script type='text/javascript'>
_vwo_clicks=10; // Change this number accordingly to the number of clicks you want to track in your VWO heatmaps/clickmaps
</script>