This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An unstructured event with no context attached | |
window.snowplow_name_here('trackUnstructEvent', { | |
schema: 'iglu:com.acme_company/viewed_product/jsonschema/2-0-0', | |
data: { | |
productId: 'ASO01043', | |
category: 'Dresses', | |
brand: 'ACME', | |
returning: true, | |
price: 49.95, | |
sizes: ['xs', 's', 'l', 'xl', 'xxl'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A structured event corresponding to playing some music with no context attached | |
window.snowplow_name_here('trackStructEvent', 'Mixes', 'Play', 'MRC/fabric-0503-mix', '', '0.0'); | |
// The same unstructured event, with two custom contexts attached - | |
// one regarding the page background and one regarding the user type | |
window.snowplow_name_here('trackStructEvent', 'Mixes', 'Play', 'MRC/fabric-0503-mix', '', '0.0', [ | |
{ | |
schema: "iglu:com.mycompany/page_style/jsonschema/1-0-0", | |
data: { | |
background_color: "white", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
In this example, there are two script elements on the page: one firing a page view and the other a structured event. | |
Each script separately contains the invocation tag for sp.js. | |
Having the invocation tag appear in each script element before any calls to snowplow_name_here guarantees that the | |
asynchronous queue is set up before any calls to snowplow_name_here push events onto it (regardless of how long it | |
takes sp.js itself to load). | |
Even though the tag is fired twice, it is designed to only set up the asynchronous queue and load sp.js once. | |
See https://github.com/snowplow/snowplow-javascript-tracker/blob/master/tags/tag.js for a more detailed explanation of the tag. | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Function to extract the Snowplow user ID from the first-party cookie set by the Snowplow JavaScript Tracker | |
* | |
* @param string cookieName (optional) The value used for "cookieName" in the tracker constructor argmap | |
* (leave blank if you did not set a custom cookie name) | |
* | |
* @return string or bool The ID string if the cookie exists or false if the cookie has not been set yet | |
*/ | |
function getSnowplowDuid(cookieName) { | |
cookieName = cookieName || '_sp_'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @license | |
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> | |
* Build: `lodash exports="node" include="isArray, isFunction, isString, isObject, isDate, isUndefined, isNull, map, filter, find, compact, isEmpty, clone, cloneDeep" --debug --output src/js/lib_managed/lodash.js` | |
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> | |
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> | |
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | |
* Available under MIT license <http://lodash.com/license> | |
*/ | |
;(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
page = 1 | |
issues = [] | |
while true do | |
current_page = Octokit.list_issues('snowplow/snowplow', {milestone: 78, state: 'open',page: page}).map {|x| x.to_hash()}; | |
if current_page.empty? | |
break | |
end | |
issues += current_page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.avro.io._ | |
import org.apache.avro.specific._ | |
import org.apache.avro.file.DataFileWriter | |
import java.util.ArrayList | |
import java.io.File | |
import example.avro._ | |
import org.apache.avro.Schema | |
import org.apache.avro.generic._ | |
import org.apache.avro.file.DataFileReader | |
import org.apache.avro.util.ByteBufferOutputStream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script updates copyright notices for all files in the current branch which have changed since master. | |
set -e | |
if [ -f tmp ]; | |
then | |
>&2 echo "Error - this script would overwrite the 'tmp' file" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// If this tag fires more than once (e.g. page view followed by ecommerce action), | |
// we don't want to repeat the trackPageView here | |
if (!window.snowplow) { | |
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[]; | |
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments) | |
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1; | |
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.2/sp.js","snowplow")); | |
OlderNewer