Trigger.io

Trigger.io Forge Documentation

Important

This documentation is deprecated, and only kept here to support users of browser extension APIs. If you are using Trigger.io for iOS or Android, see https://trigger.io/docs/.

flurry: Analytics with Flurry

The forge.flurry APIs allow you to access the native Flurry SDK, which provides usage tracking and analytics via Flurry.

Before you can use this module, you will need to have set up a Flurry application, and know its API key.

Config

The flurry module must be enabled in config.json with API keys specified for Android and/or iOS.

{
    "modules": {
        "flurry": {
            "android_api_key": "VMGKY81MY88PCDR38ARM",
            "ios_api_key": "3RAG3ZW4QXMRVNJH092S"
        }
    }
}

By just including this configuration in your app config, basic app analytics information - such as sessions, active users and new users - will be available in your Flurry dashboard.

For more advanced analytics, you can use the API methods described below.

API

flurry.customEvent

Platforms: Mobile

Send a named and optionally parameterised event to Flurry. You could use this to track a user's navigation through your app, for example.

flurry.customEvent(name, [parameters, ]success, error)
Arguments:
  • name (string) -- a name to identify this event
  • parameters (object) -- an optional hash of extra information that will be stored with this event
  • success (function()) -- callback to be invoked when no errors occur
  • error (function(content)) -- called with details of any error which may occur

flurry.startTimedEvent

Platforms: Mobile

Takes the same options as flurry.customEvent, but using flurry.endTimedEvent you are able to easily measure the time it takes for your users to move from one action to another in your app.

flurry.startTimedEvent(name, [parameters, ]success, error)
Arguments:
  • name (string) -- a name to identify this event
  • parameters (object) -- an optional hash of extra information that will be stored with this event
  • success (function()) -- callback to be invoked when no errors occur
  • error (function(content)) -- called with details of any error which may occur

flurry.endTimedEvent

Platforms: Mobile

Mark the end of a particular timed event: the name parameter should match the name parameter passed into flurry.startTimedEvent.

flurry.endTimedEvent(name, success, error)
Arguments:
  • name (string) -- a name to identify this event: should match the name passed into flurry.startTimedEvent
  • success (function()) -- callback to be invoked when no errors occur
  • error (function(content)) -- called with details of any error which may occur

flurry.setDemographics

Platforms: Mobile

Store some demographic data about the current user, to enable more advanced filtering and grouping in the Flurry dashboard.

The demographics object should contain some or all of these keys:

  • user_id: (string) a unique ID for the current user
  • age: (number) the current user's age
  • gender: (string) either "m" or "f"
flurry.setDemographics(demographics, success, error)
Arguments:
  • demographics (string) -- a hash optionally including values for user_id, age and gender
  • success (function()) -- callback to be invoked when no errors occur
  • error (function(content)) -- called with details of any error which may occur

flurry.setLocation

Platforms: Mobile

Set the user's current location: we recommend you use the geolocation module to grab the coords object which should be passed in. E.g.:

forge.geolocation.getCurrentPosition( function (position) {
    forge.flurry.setLocation(position.coords);
});
flurry.setLocation(coords, success, error)
Arguments:
  • coords (object) -- hash representing location - must include latitude, longitude and accuracy.
  • success (function(response)) -- callback to be invoked when no errors occur
  • error (function(content)) -- called with details of any error which may occur