Skip to content

Instantly share code, notes, and snippets.

View jamesspittal's full-sized avatar

James Spittal jamesspittal

View GitHub Profile
@jamesspittal
jamesspittal / ga-cross-domain-tracking.md
Created July 30, 2019 06:42 — forked from holmberd/ga-cross-domain-tracking.md
Google Analytics - Cross Domain Manual Link Tracking

Manually decorate a URL with the linker parameter for Google Tab Manager or Google Analytics

In the case where you manually want to decorate a link with the linker parameter, i.e. the link is not a valid anchor link, or the final tracking page is accessed by user in a non direct way: File Download, Extension Installation, ect...

Google Analytics

/**
 * Returns the Google Analytics tracker linker parameter.
// ==UserScript==
// @name CS VWO Info
// @version 1.1
// @description Show info on running VWO experiments
// @author Conversion Sciences
// @include /^https?:\/\/.*/
// @grant none
// @noframes
// @downloadURL https://d2t92d45b68dnb.cloudfront.net/TM/VWO.js
// ==/UserScript==
// Optimizely JavaScript API
// http://developers.optimizely.com/javascript/
// To opt a visitor out of Optimizely tracking
// http://www.example.com/page.html?optimizely_opt_out=true
// 1. API Function Calls
// http://developers.optimizely.com/javascript/#api-function-calls-2
(function getABTest() {
var abTestName = '',
abTestVariation = '',
abTest = 'No test',
abTestExperiments = optimizely.allExperiments[Object.keys(optimizely.variationMap)];
if (abTestExperiments) {
abTestVariation = Object.keys(optimizely.variationNamesMap).map(function(el) { return optimizely.variationNamesMap[el]; })[0];
abTestName = abTestExperiments.name;
abTest = abTestName + ': ' + abTestVariation;
@jamesspittal
jamesspittal / fix-wordpress-permissions.sh
Last active November 8, 2016 10:13 — forked from Adirael/fix-wordpress-permissions.sh
Fix WordPress file permissions (assuming WordPress is installed in /var/www/html and apache:apache)
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
WP_OWNER=apache
WP_GROUP=apache
WP_ROOT=/var/www/html
WS_GROUP=apache