Skip to content

Instantly share code, notes, and snippets.

@fblundun
Last active August 29, 2015 14:04
Show Gist options
  • Save fblundun/8d5a78e725d0a10095bb to your computer and use it in GitHub Desktop.
Save fblundun/8d5a78e725d0a10095bb to your computer and use it in GitHub Desktop.
Structured event with contexts
// 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",
font_size: 12
}
},
{
schema: "iglu:com.mycompany/user_type/jsonschema/1-0-0",
data: {
type: "tester"
}
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment