Skip to content

Instantly share code, notes, and snippets.

@ak--47
Last active August 4, 2016 22:54
Show Gist options
  • Save ak--47/bcb82f48ddabde02123990316ab2dafd to your computer and use it in GitHub Desktop.
Save ak--47/bcb82f48ddabde02123990316ab2dafd to your computer and use it in GitHub Desktop.
Ximble: client side mixpanel tracking (example)
$(document).ready(function(){
//initialize everyone as an unknown user
mixpanel.register({"known-user":false});
//build a list of properties to send with the page View event
var pageProps = {"page name":$(document).attr('title')}
//sends the page load event; a response of 1 on the XHR request means mixpanel got the data
mixpanel.track('Page View', pageProps)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment