A singleton class to manage analytics data. More...

Inheritance diagram for Analytics:

Public Member Functions

void addDestination (AnalyticsDestination *destination)
 Adds an AnalyticsDestination to the list of AnalyticsDestinations managed by this Analytics object. More...
 
void setUserId (const String &newUserId)
 Sets a user ID that will be added to all AnalyticsEvents sent to AnalyticsDestinations. More...
 
void setUserProperties (const StringPairArray &properties)
 Sets some user properties that will be added to all AnalyticsEvents sent to AnalyticsDestinations. More...
 
void logEvent (const String &eventName, const StringPairArray &parameters)
 Sends an AnalyticsEvent to all AnalyticsDestinations. More...
 
void setSuspended (bool shouldBeSuspended)
 Suspends analytics submission to AnalyticsDestinations. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DeletedAtShutdown
static void deleteAll ()
 Deletes all extant objects. More...
 
- Protected Member Functions inherited from DeletedAtShutdown
 DeletedAtShutdown ()
 Creates a DeletedAtShutdown object. More...
 
virtual ~DeletedAtShutdown ()
 Destructor. More...
 

Detailed Description

A singleton class to manage analytics data.

Use an Analytics object to manage sending analytics data to one or more AnalyticsDestinations.

See also
AnalyticsDestination, ThreadedAnalyticsDestination, AnalyticsDestination::AnalyticsEvent

Member Function Documentation

◆ addDestination()

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.

Parameters
destinationthe AnalyticsDestination to manage

◆ setUserId()

void Analytics::setUserId ( const String newUserId)

Sets a user ID that will be added to all AnalyticsEvents sent to AnalyticsDestinations.

Parameters
newUserIdthe userId to add to AnalyticsEvents

◆ setUserProperties()

void Analytics::setUserProperties ( const StringPairArray properties)

Sets some user properties that will be added to all AnalyticsEvents sent to AnalyticsDestinations.

Parameters
propertiesthe userProperties to add to AnalyticsEvents

◆ logEvent()

void Analytics::logEvent ( const String eventName,
const StringPairArray parameters 
)

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 and parameters will be populated by the arguments supplied to this function.

Parameters
eventNamethe event name
parametersthe event parameters

◆ setSuspended()

void Analytics::setSuspended ( bool  shouldBeSuspended)

Suspends analytics submission to AnalyticsDestinations.

Parameters
shouldBeSuspendedif event submission should be suspended

The documentation for this class was generated from the following file: