Skip to content

Instantly share code, notes, and snippets.

@MeryllEssig
Forked from LeCoupa/mixpanel-cheatsheet.js
Created August 28, 2017 15:11
Show Gist options
  • Select an option

  • Save MeryllEssig/57a8ffbfa31571cf3f28a33edd1ae10d to your computer and use it in GitHub Desktop.

Select an option

Save MeryllEssig/57a8ffbfa31571cf3f28a33edd1ae10d to your computer and use it in GitHub Desktop.

Revisions

  1. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ mixpanel.identify("13483"); // Identify a user with a unique id.
    mixpanel.get_distinct_id(); // Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to mixpanel.identify.
    mixpanel.alias("new_id", "existing_id"); // Create an alias, which Mixpanel will use to link two distinct_ids going forward (not retroactively).

    mixpanel.get_property('property_name'); // Returns the value of the super property named property_name. If no such property is set, get_property will return the undefined value.
    mixpanel.get_property('property_name'); // Returns the value of the super property named property_name. If no such property is set, get_property will return the undefined value.

    mixpanel.people.set('gender', 'm', callback); // Set properties on a user record.
    mixpanel.people.set_once('First Login Date', new Date(), callback); // Set properties on a user record, only if they do not yet exist.
  2. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ mixpanel.identify("13483"); // Identify a user with a unique id.
    mixpanel.get_distinct_id(); // Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to mixpanel.identify.
    mixpanel.alias("new_id", "existing_id"); // Create an alias, which Mixpanel will use to link two distinct_ids going forward (not retroactively).

    mixpanel.get_property('mySuperProperty'); // Returns the value of the super property named property_name. If no such property is set, get_property will return the undefined value.
    mixpanel.get_property('property_name'); // Returns the value of the super property named property_name. If no such property is set, get_property will return the undefined value.

    mixpanel.people.set('gender', 'm', callback); // Set properties on a user record.
    mixpanel.people.set_once('First Login Date', new Date(), callback); // Set properties on a user record, only if they do not yet exist.
  3. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ mixpanel.people.append('pages_visited', 'homepage', callback); // Append a
    mixpanel.people.delete_user(); // Permanently deletes the current people analytics profile from Mixpanel (using the current distinct_id).

    mixpanel.people.track_charge(30.50, { // Record that you have charged the current user a certain amount of money. Charges recorded with track_charge will appear in the Mixpanel revenue report.
    '$time': new Date('jan 1 2012') // Charge a user $30.50 on the 2nd of january
    '$time': new Date('jan 1 2012') // Charge a user $30.50 on the 2nd of january
    }, callback);

    mixpanel.people.clear_charges(callback); // Permanently clear all revenue report transactions from the current user's people analytics profile.
  4. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -44,28 +44,28 @@ mixpanel.get_config(); // Returns the current config object for the library.

    mixpanel.config({ // Update the configuration of a mixpanel library instance. The default config is:
    // super properties span subdomains
    cross_subdomain_cookie: true
    cross_subdomain_cookie: true,

    // super properties cookie name
    cookie_name: ""
    cookie_name: "",

    // super properties cookie expiration (in days)
    cookie_expiration: 365
    cookie_expiration: 365,

    // should we track a page view on page load
    track_pageview: true
    track_pageview: true,

    // the amount of time track_links will
    // wait for Mixpanel's servers to respond
    track_links_timeout: 300
    track_links_timeout: 300,

    // if this is true, the mixpanel cookie will be deleted,
    // and no user persistence will take place
    disable_cookie: false
    disable_cookie: false,

    // if this is true, the mixpanel cookie will be marked as
    // secure, meaning it will only be transmitted over https
    secure_cookie: false
    secure_cookie: false,

    // if you set upgrade to be true, the library will check for a
    // cookie from our old js library and import super
  5. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -14,9 +14,9 @@ mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback);
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.

    mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
    mixpanel.register_once({'MySuperProperties': 'Value'}, 'None', 2) // Register a set of super properties only once. This will not overwrite previous super property values, unlike register().
    mixpanel.unregister('MySuperProperties'); // Delete a super property stored with the current user.
    mixpanel.register({'MySuperProperties': 'Value'}, 2); // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
    mixpanel.register_once({'MySuperProperties': 'Value'}, 'None', 2); // Register a set of super properties only once. This will not overwrite previous super property values, unlike register().
    mixpanel.unregister('MySuperProperties'); // Delete a super property stored with the current user.

    mixpanel.identify("13483"); // Identify a user with a unique id. All subsequent actions caused by this user will be tied to this identity.
    mixpanel.get_distinct_id(); // Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to mixpanel.identify.
    @@ -28,7 +28,7 @@ mixpanel.people.set('gender', 'm', callback); // Set prop
    mixpanel.people.set_once('First Login Date', new Date(), callback); // Set properties on a user record, only if they do not yet exist.
    mixpanel.people.increment('points', 5); // Increment/decrement numeric people analytics properties.
    mixpanel.people.append('pages_visited', 'homepage', callback); // Append a value to a list-valued people analytics property.
    mixpanel.people.delete_user() // Permanently deletes the current people analytics profile from Mixpanel (using the current distinct_id).
    mixpanel.people.delete_user(); // Permanently deletes the current people analytics profile from Mixpanel (using the current distinct_id).

    mixpanel.people.track_charge(30.50, { // Record that you have charged the current user a certain amount of money. Charges recorded with track_charge will appear in the Mixpanel revenue report.
    '$time': new Date('jan 1 2012') // Charge a user $30.50 on the 2nd of january
    @@ -40,9 +40,9 @@ mixpanel.people.clear_charges(callback); // Permanently clear all revenue repor
    // 2. Library Configuration.


    mixpanel.get_config() // Returns the current config object for the library.
    mixpanel.get_config(); // Returns the current config object for the library.

    mixpanel.config({ // Update the configuration of a mixpanel library instance. The default config is:
    mixpanel.config({ // Update the configuration of a mixpanel library instance. The default config is:
    // super properties span subdomains
    cross_subdomain_cookie: true

    @@ -73,4 +73,4 @@ mixpanel.config({ // Update the configuration of a mixpanel library instanc
    // The upgrade config option only works in the initialization,
    // so make sure you set it when you create the library.
    upgrade: false
    })
    });
  6. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ mixpanel.people.append('pages_visited', 'homepage', callback); // Append a
    mixpanel.people.delete_user() // Permanently deletes the current people analytics profile from Mixpanel (using the current distinct_id).

    mixpanel.people.track_charge(30.50, { // Record that you have charged the current user a certain amount of money. Charges recorded with track_charge will appear in the Mixpanel revenue report.
    '$time': new Date('jan 1 2012') // Charge a user $30.50 on the 2nd of january
    '$time': new Date('jan 1 2012') // Charge a user $30.50 on the 2nd of january
    }, callback);

    mixpanel.people.clear_charges(callback); // Permanently clear all revenue report transactions from the current user's people analytics profile.
  7. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -28,6 +28,7 @@ mixpanel.people.set('gender', 'm', callback); // Set prop
    mixpanel.people.set_once('First Login Date', new Date(), callback); // Set properties on a user record, only if they do not yet exist.
    mixpanel.people.increment('points', 5); // Increment/decrement numeric people analytics properties.
    mixpanel.people.append('pages_visited', 'homepage', callback); // Append a value to a list-valued people analytics property.
    mixpanel.people.delete_user() // Permanently deletes the current people analytics profile from Mixpanel (using the current distinct_id).

    mixpanel.people.track_charge(30.50, { // Record that you have charged the current user a certain amount of money. Charges recorded with track_charge will appear in the Mixpanel revenue report.
    '$time': new Date('jan 1 2012') // Charge a user $30.50 on the 2nd of january
  8. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,12 @@ mixpanel.people.set_once('First Login Date', new Date(), callback); // Set prop
    mixpanel.people.increment('points', 5); // Increment/decrement numeric people analytics properties.
    mixpanel.people.append('pages_visited', 'homepage', callback); // Append a value to a list-valued people analytics property.

    mixpanel.people.track_charge(30.50, { // Record that you have charged the current user a certain amount of money. Charges recorded with track_charge will appear in the Mixpanel revenue report.
    '$time': new Date('jan 1 2012') // Charge a user $30.50 on the 2nd of january
    }, callback);

    mixpanel.people.clear_charges(callback); // Permanently clear all revenue report transactions from the current user's people analytics profile.


    // 2. Library Configuration.

  9. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,8 @@ mixpanel.get_property('mySuperProperty'); // Returns the value of the super pro
    mixpanel.people.set('gender', 'm', callback); // Set properties on a user record.
    mixpanel.people.set_once('First Login Date', new Date(), callback); // Set properties on a user record, only if they do not yet exist.
    mixpanel.people.increment('points', 5); // Increment/decrement numeric people analytics properties.
    mixpanel.people.append('pages_visited', 'homepage', callback); // Append a value to a list-valued people analytics property.


    // 2. Library Configuration.

  10. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,9 @@ mixpanel.alias("new_id", "existing_id"); // Create an alias, which Mixpanel wi

    mixpanel.get_property('mySuperProperty'); // Returns the value of the super property named property_name. If no such property is set, get_property will return the undefined value.

    mixpanel.people.set('gender', 'm', callback); // Set properties on a user record.
    mixpanel.people.set_once('First Login Date', new Date(), callback); // Set properties on a user record, only if they do not yet exist.
    mixpanel.people.increment('points', 5); // Increment/decrement numeric people analytics properties.

    // 2. Library Configuration.

  11. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,6 @@ mixpanel.alias("new_id", "existing_id"); // Create an alias, which Mixpanel wi
    mixpanel.get_property('mySuperProperty'); // Returns the value of the super property named property_name. If no such property is set, get_property will return the undefined value.



    // 2. Library Configuration.


  12. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,9 @@ mixpanel.identify("13483"); // Identify a user with a unique id.
    mixpanel.get_distinct_id(); // Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to mixpanel.identify.
    mixpanel.alias("new_id", "existing_id"); // Create an alias, which Mixpanel will use to link two distinct_ids going forward (not retroactively).

    mixpanel.get_property('mySuperProperty'); // Returns the value of the super property named property_name. If no such property is set, get_property will return the undefined value.



    // 2. Library Configuration.

  13. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -24,10 +24,11 @@ mixpanel.alias("new_id", "existing_id"); // Create an alias, which Mixpanel wi


    // 2. Library Configuration.
    // Update the configuration of a mixpanel library instance. The default config is:


    mixpanel.config({
    mixpanel.get_config() // Returns the current config object for the library.

    mixpanel.config({ // Update the configuration of a mixpanel library instance. The default config is:
    // super properties span subdomains
    cross_subdomain_cookie: true

  14. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 41 additions and 1 deletion.
    42 changes: 41 additions & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,9 @@
    // https://mixpanel.com/help/reference/javascript-full-api-reference


    // 1. API Methods.


    mixpanel.init('new token', { your: 'config' }, 'library_name'); // initialize a new instance of the Mixpanel tracking object
    mixpanel.push(['register', { a: 'b' }]); // push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet).
    mixpanel.disable('eventToDisable'); // Disable events on the Mixpanel object. If passed no arguments, this function disables tracking of any event. If passed an array of event names, those events will be disabled, but other events will continue to be tracked.
    @@ -18,4 +21,41 @@ mixpanel.unregister('MySuperProperties'); // Delete a s
    mixpanel.identify("13483"); // Identify a user with a unique id. All subsequent actions caused by this user will be tied to this identity.
    mixpanel.get_distinct_id(); // Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to mixpanel.identify.
    mixpanel.alias("new_id", "existing_id"); // Create an alias, which Mixpanel will use to link two distinct_ids going forward (not retroactively).



    // 2. Library Configuration.
    // Update the configuration of a mixpanel library instance. The default config is:


    mixpanel.config({
    // super properties span subdomains
    cross_subdomain_cookie: true

    // super properties cookie name
    cookie_name: ""

    // super properties cookie expiration (in days)
    cookie_expiration: 365

    // should we track a page view on page load
    track_pageview: true

    // the amount of time track_links will
    // wait for Mixpanel's servers to respond
    track_links_timeout: 300

    // if this is true, the mixpanel cookie will be deleted,
    // and no user persistence will take place
    disable_cookie: false

    // if this is true, the mixpanel cookie will be marked as
    // secure, meaning it will only be transmitted over https
    secure_cookie: false

    // if you set upgrade to be true, the library will check for a
    // cookie from our old js library and import super
    // properties from it, then the old cookie is deleted
    // The upgrade config option only works in the initialization,
    // so make sure you set it when you create the library.
    upgrade: false
    })
  15. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -15,5 +15,7 @@ mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a
    mixpanel.register_once({'MySuperProperties': 'Value'}, 'None', 2) // Register a set of super properties only once. This will not overwrite previous super property values, unlike register().
    mixpanel.unregister('MySuperProperties'); // Delete a super property stored with the current user.

    mixpanel.identify("13483"); // Identify a user with a unique id. All subsequent actions caused by this user will be tied to this identity.
    mixpanel.get_distinct_id(); // Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to mixpanel.identify.
    mixpanel.identify("13483"); // Identify a user with a unique id. All subsequent actions caused by this user will be tied to this identity.
    mixpanel.get_distinct_id(); // Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to mixpanel.identify.
    mixpanel.alias("new_id", "existing_id"); // Create an alias, which Mixpanel will use to link two distinct_ids going forward (not retroactively).

  16. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -14,3 +14,6 @@ mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 2
    mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
    mixpanel.register_once({'MySuperProperties': 'Value'}, 'None', 2) // Register a set of super properties only once. This will not overwrite previous super property values, unlike register().
    mixpanel.unregister('MySuperProperties'); // Delete a super property stored with the current user.

    mixpanel.identify("13483"); // Identify a user with a unique id. All subsequent actions caused by this user will be tied to this identity.
    mixpanel.get_distinct_id(); // Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to mixpanel.identify.
  17. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -11,5 +11,6 @@ mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback);
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.

    mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
    mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
    mixpanel.register_once({'MySuperProperties': 'Value'}, 'None', 2) // Register a set of super properties only once. This will not overwrite previous super property values, unlike register().
    mixpanel.unregister('MySuperProperties'); // Delete a super property stored with the current user.
  18. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,4 @@ mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21});
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.

    mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
    mixpanel.register_once({'MySuperProperties': 'Value'}, false, 2) // Register a set of super properties only once. This will not overwrite previous super property values, unlike register().
    mixpanel.register_once({'MySuperProperties': 'Value'}, 'None', 2) // Register a set of super properties only once. This will not overwrite previous super property values, unlike register().
  19. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,5 @@ mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback);
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.

    mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
    mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
    mixpanel.register_once({'MySuperProperties': 'Value'}, false, 2) // Register a set of super properties only once. This will not overwrite previous super property values, unlike register().
  20. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,6 @@ mixpanel.disable('eventToDisable'); // Disable even

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.

    mixpanel.register({'MySuperProperties': 'Value'}, 2) // Register a set of super properties, which are included with all events. This will overwrite previous super property values.
  21. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@


    mixpanel.init('new token', { your: 'config' }, 'library_name'); // initialize a new instance of the Mixpanel tracking object
    mixpanel.push(['register', { a: 'b' }]); // push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet). Good example is Optimizely.
    mixpanel.push(['register', { a: 'b' }]); // push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet).
    mixpanel.disable('eventToDisable'); // Disable events on the Mixpanel object. If passed no arguments, this function disables tracking of any event. If passed an array of event names, those events will be disabled, but other events will continue to be tracked.

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event.
  22. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -8,5 +8,5 @@ mixpanel.push(['register', { a: 'b' }]); // push() keeps
    mixpanel.disable('eventToDisable'); // Disable events on the Mixpanel object. If passed no arguments, this function disables tracking of any event. If passed an array of event names, those events will be disabled, but other events will continue to be tracked.

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.
  23. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,6 @@ mixpanel.init('new token', { your: 'config' }, 'library_name'); // initialize a
    mixpanel.push(['register', { a: 'b' }]); // push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet). Good example is Optimizely.
    mixpanel.disable('eventToDisable'); // Disable events on the Mixpanel object. If passed no arguments, this function disables tracking of any event. If passed an array of event names, those events will be disabled, but other events will continue to be tracked.

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. This is the most important Mixpanel function and the one you will be using the most.
    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.
  24. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@ mixpanel.disable('eventToDisable'); // Disable even

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. This is the most important Mixpanel function and the one you will be using the most.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21});
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.
  25. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@ mixpanel.disable('eventToDisable'); // Disable even

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. This is the most important Mixpanel function and the one you will be using the most.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21});
  26. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@ mixpanel.disable('eventToDisable'); // Disable even

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. This is the most important Mixpanel function and the one you will be using the most.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions. Selector must be a valid query.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.
  27. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@ mixpanel.disable('eventToDisable'); // Disable even

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. This is the most important Mixpanel function and the one you will be using the most.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21});
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions. Selector must be a valid query.
  28. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@ mixpanel.disable('eventToDisable'); // Disable even

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. This is the most important Mixpanel function and the one you will be using the most.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_forms('#register', 'Created Account');
    mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21});
  29. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@ mixpanel.disable('eventToDisable'); // Disable even

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. This is the most important Mixpanel function and the one you will be using the most.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_forms("#register", "Created Account");
    mixpanel.track_forms('#register', 'Created Account');
  30. Julien Le Coupanec revised this gist Mar 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mixpanel-cheatsheet.js
    Original file line number Diff line number Diff line change
    @@ -8,5 +8,5 @@ mixpanel.push(['register', { a: 'b' }]); // push() keeps
    mixpanel.disable('eventToDisable'); // Disable events on the Mixpanel object. If passed no arguments, this function disables tracking of any event. If passed an array of event names, those events will be disabled, but other events will continue to be tracked.

    mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. This is the most important Mixpanel function and the one you will be using the most.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query. Elements must exist on the page at the time track_links is called.
    mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. Selector must be a valid query.
    mixpanel.track_forms("#register", "Created Account");