firebase:: analytics:: Parameter
#include <analytics.h>
Event parameter.
Summary
Parameters supply information that contextualize events (seeLogEvent). You can associate up to 25 unique Parameters with each event type (name).
Common event types (names) are suggested inAnalytics Events (event_names.h) with parameters of common event types defined inAnalytics Parameters (parameter_names.h).
You are not limited to the set of event types and parameter names suggested inAnalytics Events (event_names.h) and parameter_names.h respectively. Additional Parameters can be supplied for suggested event types or custom Parameters for custom event types.
Parameter names must be a combination of letters and digits (matching the regular expression [a-zA-Z0-9]) between 1 and 40 characters long starting with a letter [a-zA-Z] character. The "firebase_", "google_" and "ga_" prefixes are reserved and should not be used.
Parameter string values can be up to 100 characters long.
An array of this structure is passed to LogEvent in order to associate parameter's of an event (Parameter::name) with values (Parameter::value) where each value can be a double, 64-bit integer or string.
For example, a game may log an achievement event along with the character the player is using and the level they're currently on:
usingnamespacefirebase::analytics;int64_tcurrent_level=GetCurrentLevel();constParameterachievement_parameters[]={Parameter(kParameterAchievementID,"ultimate_wizard"),Parameter(kParameterCharacter,"mysterion"),Parameter(kParameterLevel,current_level),};LogEvent(kEventUnlockAchievement,achievement_parameters,sizeof(achievement_parameters)/sizeof(achievement_parameters[0]));
Constructors and Destructors | |
|---|---|
Parameter()Construct an empty parameter. | |
Parameter(const char *parameter_name,Variant parameter_value)Construct a parameter. | |
Parameter(const char *parameter_name, int parameter_value)Construct a 64-bit integer parameter. | |
Parameter(const char *parameter_name, int64_t parameter_value)Construct a 64-bit integer parameter. | |
Parameter(const char *parameter_name, double parameter_value)Construct a floating point parameter. | |
Parameter(const char *parameter_name, const char *parameter_value)Construct a string parameter. |
Public attributes | |
|---|---|
name | const char *Name of the parameter. |
value | Value of the parameter. |
Public attributes
name
constchar*firebase::analytics::Parameter::name
Name of the parameter.
Parameter names must be a combination of letters and digits (matching the regular expression [a-zA-Z0-9]) between 1 and 40 characters long starting with a letter [a-zA-Z] character. The "firebase_", "google_" and "ga_" prefixes are reserved and should not be used.
value
Variantfirebase::analytics::Parameter::value
Value of the parameter.
Seefirebase::Variant for usage information.Note: String values can be up to 100 characters long.
Public functions
Parameter
firebase::analytics::Parameter::Parameter()
Construct an empty parameter.
This is provided to allow initialization after construction.
Parameter
firebase::analytics::Parameter::Parameter(constchar*parameter_name,Variantparameter_value)
Construct a parameter.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
Parameter
firebase::analytics::Parameter::Parameter(constchar*parameter_name,intparameter_value)
Construct a 64-bit integer parameter.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
Parameter
firebase::analytics::Parameter::Parameter(constchar*parameter_name,int64_tparameter_value)
Construct a 64-bit integer parameter.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
Parameter
firebase::analytics::Parameter::Parameter(constchar*parameter_name,doubleparameter_value)
Construct a floating point parameter.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
Parameter
firebase::analytics::Parameter::Parameter(constchar*parameter_name,constchar*parameter_value)
Construct a string parameter.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-23 UTC.