Code Monkey home page Code Monkey logo

dart-mixpanel's Introduction

Mixpanel for Dart

A Dart wrapper around the Mixpanel JS API.

Note: This package is not officially provided by Mixpanel. However it does rely on the official Mixpanel JS library.

Install

This is a pub package. To install it, and link it into your app, add mixpanel to your pubspec.yaml. For example:

name: your_cool_app
dependencies:
  mixpanel: any

If you use the Dart Editor, the IDE will automatically download the package for you.

If you use the command line, ensure the Dart SDK is on your path, and the run: pub install.

Example

Load your Mixpanel JS library in <head> as usual, then invoke any Mixpanel methods from your Dart code after instantiating the Mixpanel class:

import 'package:mixpanel/mixpanel.dart';

// Lazy loaded
final Mixpanel mixpanel = new Mixpanel();

main() {
  // Track an event
  mixpanel.track("Hello from Dart!");
}

See the example directory for a minimal Dart program.

API

  • void track(String event_name, {Map properties, Function callback})
  • void track_links(String css_selector, String event_name, {var properties})
  • void track_forms(String css_selector, String event_name, {var properties})
  • void track_pageview({String page})
  • void register(Map properties)
  • void register_once(Map properties, {var default_value})
  • void unregister(String property_name)
  • get_property(String property_name)
  • void identify(String unique_id)
  • void alias(String alias)
  • get_distinct_id()
  • void name_tag(String name)
  • void set_config(Map config)
  • void init(String token, {Map config, String name})
  • void disable({List events})

See the official Mixpanel JS API for further details on each method.

Support

You can file issues at https://github.com/zugaldia/dart-mixpanel/issues.

Authors

License

See LICENSE

dart-mixpanel's People

Contributors

jonathanhughes avatar zugaldia avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

dart-mixpanel's Issues

Improve testing

Testing now is limited to checking that the API matches using reflection.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.