https://github.com/poetic/cordova-mixpanel
https://github.com/poetic/cordova-mixpanel
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/poetic/cordova-mixpanel
- Owner: poetic
- Created: 2014-06-05T03:09:45.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-05T13:50:20.000Z (about 11 years ago)
- Last Synced: 2025-03-24T20:22:53.938Z (3 months ago)
- Language: Objective-C
- Size: 219 KB
- Stars: 14
- Watchers: 8
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cordova-mixpanel
*iOS only right now. We would happily accept an Android support pull request*
Cordova plugin that integrates the Native Mixpanel SDK in your cordova
application. Use it to track events, people, or revenue. You can also display
in-app notifications or surveys.It works with cordova-3.4.0+
## Installation
1. You can install it as part of cordova hooks.
2. or just run the following in your project:
```
cordova plugin add https://github.com/poetic/cordova-mixpanel.git
```## API
Make sure you call identify or createAlias with your mixpanel token found in your mixpanel
settings first.```javascript
// Callbacks: s and f are success/failure callbacks respectively
// Strings: token, eventName, distinctId, alias
// JS Objects: properties
// Booleans: bool
Mixpanel.init(token, s, f)
Mixpanel.createAlias(alias, s, f)
Mixpanel.track(eventName, properties, s, f)
Mixpanel.identify(distinctId, s, f)
Mixpanel.peopleSet(properties, s, f)
Mixpanel.trackCharge(amount, s, f)
Mixpanel.trackChargeWithProperties(amount, properties, s, f)
Mixpanel.setShowNotificationOnActive(bool, s, f)
Mixpanel.showNotification(s, f)
Mixpanel.showNotificationWithID(id, s, f)
Mixpanel.setShowSurveyOnActive(bool, s, f)
Mixpanel.showSurvey(s, f)
Mixpanel.showSurveyWithID (id, s, f)// Push Notifications
// Options: { badge: true, alert: true, sound: false}
Mixpanel.register(options, s, f)
Mixpanel.unregister(options, s, f)
Mixpanel.setApplicationIconBadgeNumber(badgeNumber, s, f)document.addEventListener('mixpanel.push', function(event){})
```