Flurry Analytics Plugin for Cordova
Adds support for Flurry Analytics to your Cordova or PhoneGap apps.
This plugin was heavily inspired by https://github.com/jfpsf/flurry-phonegap-plugin. Big thanks to its creators.
How do I install it?
If you're like me and using Cordova CLI:
cordova plugin add cordova-plugin-flurryanalytics2
TODO: add manual installation steps
How do I use it?
TODO: complete usage documentation
flurryAnalytics = new FlurryAnalytics({
appKey: '<your app key>',
version: 'my_custom_version',
continueSessionSeconds: 3,
userId: 'blakgeek',
gender: 'm',
age: 38,
logLevel: 'ERROR',
enablePulse: true,
enableLogging: true,
enableEventLogging: false,
enableCrashReporting: true,
enableBackgroundSessions: true,
reportSessionsOnClose: false,
reportSessionsOnPause: false
});
flurryAnalytics.setUserId('OwnUser', function() {
console.log('Cool!');
}, function(err) {
console.error(['WTF?', err]);
});
flurryAnalytics.setAge(25, function() {
console.log('Ah yeah!');
}, function(err) {
console.error(['WTF?', err]);
});
flurryAnalytics.setGender('FEMALE', function() {
console.log('woop woop!');
}, function(err) {
console.error(['WTF?', err]);
});
flurryAnalytics.logEvent('dinner time', function() {
console.log('Nice!');
}, function(err) {
console.error(['WTF?', err]);
});
var ovenParams = {
temp: 350,
mode: 'convection',
rackPosition: 'center'
}
flurryAnalytics.logEvent('set oven', ovenParams, function() {
console.log('Schweet!');
}, function(err) {
console.error(['WTF?', err]);
});
flurryAnalytics.startTimedEvent('bake chicken', function() {
console.log('Hmmmm chicken');
}, function(err) {
console.error(['WTF?', err]);
});
var riceParams = {
salt: '2tsp',
pepper: 'dash',
water: '2cups'
}
flurryAnalytics.startTimedEvent('prep rice', riceParams, function() {
console.log('Rice is prep started');
}, function(err) {
console.error(['WTF?', err]);
});
flurryAnalytics.endTimedEvent('bake chicken', function() {
console.log('Winner winner chicken dinner');
}, function(err) {
console.error(['WTF?', err]);
});
var newRiceParams = {
butter: '2pads'
}
flurryAnalytics.endTimedEvent('prep rice', newRiceParams, function() {
console.log('Winner winner chicken dinner');
}, function(err) {
console.error(['WTF?', err]);
});
flurryAnalytics.logError('NO_EtOH', "We're out of wine and beer", function() {
console.log('The authorities have been alerted');
}, function(err) {
console.error(['WTF?', err]);
});
flurryAnalytics.logPageView(function() {
console.log('I see you playa');
}, function(err) {
console.error(['WTF?', err]);
});
var location = {
latitude: 17.2500,
longitude: -62.6667,
verticalAccuracy: -1,
horizontalAccuracy: 1440
}
flurryAnalytics.setLocation(location, function() {
console.log('Party over here');
}, function(err) {
console.error(['WTF?', err]);
});