Skip to content

Instantly share code, notes, and snippets.

@alfhh
alfhh / ga-video.js
Created July 10, 2017 20:17 — forked from kyleridolfo/ga-video.js
HTML5 Video Tracking for Google Tag Manager
<script>
// Let's wrap everything inside a function so variables are not defined as globals
(function(){
// This is gonna our percent buckets ( 10%-90% )
var divisor = 10;
// We're going to save our players status on this object.
var videos_status = {};
// This is the funcion that is gonna handle the event sent by the player listeners
function eventHandler(e){
switch(e.type) {
@OrenBochman
OrenBochman / 0_BQ_description.md
Last active October 25, 2023 15:54
Big Query for GA analytics

BigQuery for Google Analytics

No metrics in

Self Joins

  • Cross Join example
  • Inner Join example

joins can be inefficent - they can require moving lots of data around and increase the data process from n to n * n

@japboy
japboy / index.html
Last active July 10, 2021 13:37
Client-side error logging with Google Analytics
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Logging Test for Google Analytics</title>
<style>
button {
position: relative;
<?php
/**
* 1. create project at https://console.developers.google.com/project
* 2. enable 'Analytics API' under 'APIs & auth' / APIs
* 3. create 'NEW CLIENT ID' (OAuth client) under 'APIs & auth' / Credentials
* i. select 'Service account'
* ii. save generated key file to 'key.p12'
* iii. remember CLIENT ID
* 4. under GA account add 'Read & Analyze' access to newly generated email (access to GA Account not Property nor View)