A class that automatically sends analytics events to the Analytics singleton when a button is clicked. More...

Inheritance diagram for ButtonTracker:

Public Member Functions

 ButtonTracker (Button &buttonToTrack, const String &triggeredEventName, const StringPairArray &triggeredEventParameters={})
 Creating one of these automatically sends analytics events to the Analytics singeton when the corresponding button is clicked. More...
 
 ~ButtonTracker ()
 Destructor. More...
 

Detailed Description

A class that automatically sends analytics events to the Analytics singleton when a button is clicked.

See also
Analytics, AnalyticsDestination::AnalyticsEvent

Constructor & Destructor Documentation

◆ ButtonTracker()

ButtonTracker::ButtonTracker ( Button buttonToTrack,
const String triggeredEventName,
const StringPairArray triggeredEventParameters = {} 
)

Creating one of these automatically sends analytics events to the Analytics singeton when the corresponding button is clicked.

The name and parameters of the analytics event will be populated from the variables supplied here. If clicking changes the button's state then the parameters will have a {"ButtonState", "On"/"Off"} entry added.

Parameters
buttonToTrackthe button to track
triggeredEventNamethe name of the generated event
triggeredEventParametersthe parameters to add to the generated event
See also
Analytics, AnalyticsDestination::AnalyticsEvent

◆ ~ButtonTracker()

ButtonTracker::~ButtonTracker ( )

Destructor.


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