Skip to content

Instantly share code, notes, and snippets.


AK ak--47

View GitHub Profile
ak--47 / vanillaTrackStuff.js
Created Jul 19, 2020
Mixpanel .track() with no dependencies
View vanillaTrackStuff.js
//a vanilla implementation of .track()
//by AK
function trackStuff(uuid, eventName, props, token) {
//the mixpanel data model
let spec = {
"event": eventName,
"properties": {
// these two properties are required!
ak--47 / exampleSPAimplementations.js
Last active Jul 19, 2020
An Example of Mixpanel inside a SPA
View exampleSPAimplementations.js
//an example of Mixpanel implemented in a frameworkless SPA
//by AK
const app = {
init: function() {
console.log("app init!");
this.authUser().then((user) => {
View genesis_public_key
ak--47 / mixpanel.js
Last active Aug 4, 2016
Ximble: client side mixpanel tracking (example)
View mixpanel.js
//initialize everyone as an unknown user
//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)
You can’t perform that action at this time.