A singleton class to manage analytics data. More...
#include <juce_Analytics.h>
Public Member Functions | |
void | addDestination (AnalyticsDestination *destination) |
Adds an AnalyticsDestination to the list of AnalyticsDestinations managed by this Analytics object. | |
OwnedArray< AnalyticsDestination > & | getDestinations () |
Returns the array of AnalyticsDestinations managed by this class. | |
void | setUserId (String newUserId) |
Sets a user ID that will be added to all AnalyticsEvents sent to AnalyticsDestinations. | |
void | setUserProperties (StringPairArray properties) |
Sets some user properties that will be added to all AnalyticsEvents sent to AnalyticsDestinations. | |
void | logEvent (const String &eventName, const StringPairArray ¶meters, int eventType=0) |
Sends an AnalyticsEvent to all AnalyticsDestinations. | |
void | setSuspended (bool shouldBeSuspended) |
Suspends analytics submissions to AnalyticsDestinations. | |
Additional Inherited Members | |
Static Public Member Functions inherited from DeletedAtShutdown | |
static void | deleteAll () |
Deletes all extant objects. | |
Protected Member Functions inherited from DeletedAtShutdown | |
DeletedAtShutdown () | |
Creates a DeletedAtShutdown object. | |
virtual | ~DeletedAtShutdown () |
Destructor. | |
A singleton class to manage analytics data.
Use an Analytics object to manage sending analytics data to one or more AnalyticsDestinations.
void Analytics::addDestination | ( | AnalyticsDestination * | destination | ) |
Adds an AnalyticsDestination to the list of AnalyticsDestinations managed by this Analytics object.
The Analytics class will take ownership of the AnalyticsDestination passed to this function.
destination | the AnalyticsDestination to manage |
OwnedArray< AnalyticsDestination > & Analytics::getDestinations | ( | ) |
Returns the array of AnalyticsDestinations managed by this class.
If you have added any subclasses of ThreadedAnalyticsDestination to this class then you can remove them from this list to force them to flush any pending events.
void Analytics::setUserId | ( | String | newUserId | ) |
Sets a user ID that will be added to all AnalyticsEvents sent to AnalyticsDestinations.
newUserId | the userId to add to AnalyticsEvents |
void Analytics::setUserProperties | ( | StringPairArray | properties | ) |
Sets some user properties that will be added to all AnalyticsEvents sent to AnalyticsDestinations.
properties | the userProperties to add to AnalyticsEvents |
void Analytics::logEvent | ( | const String & | eventName, |
const StringPairArray & | parameters, | ||
int | eventType = 0 ) |
Sends an AnalyticsEvent to all AnalyticsDestinations.
The AnalyticsEvent will be timestamped, and will have the userId and userProperties populated by values previously set by calls to setUserId and setUserProperties. The name, parameters and type will be populated by the arguments supplied to this function.
eventName | the event name |
parameters | the event parameters |
eventType | (optional) an integer to indicate the event type, which will be set to 0 if not supplied. |
void Analytics::setSuspended | ( | bool | shouldBeSuspended | ) |
Suspends analytics submissions to AnalyticsDestinations.
shouldBeSuspended | if event submission should be suspended |