Stay organized with collections
Save and categorize content based on your preferences.
firebase::analytics::Parameter
#include <analytics.h>
Event parameter.
Summary
Parameters supply information that contextualize events (see LogEvent). You can associate up to 25 unique Parameters with each event type (name).
Common event types (names) are suggested in Analytics Events (event_names.h) with parameters of common event types defined in Analytics Parameters (parameter_names.h).
You are not limited to the set of event types and parameter names suggested in Analytics 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:
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.
[null,null,["Last updated 2024-01-23 UTC."],[],[],null,["firebase::analytics::Parameter\n\n\n`#include \u003canalytics.h\u003e`\n\nEvent parameter.\n\nSummary\n\nParameters supply information that contextualize events (see [LogEvent](/docs/reference/cpp/namespace/firebase/analytics#namespacefirebase_1_1analytics_1a93b61cf7740883d81eeaa442d951ac82)). You can associate up to 25 unique Parameters with each event type (name).\n\nCommon event types (names) are suggested in [Analytics Events](/docs/reference/cpp/group/event-names#group__event__names) (event_names.h) with parameters of common event types defined in [Analytics Parameters](/docs/reference/cpp/group/parameter-names#group__parameter__names) (parameter_names.h).\n\nYou are not limited to the set of event types and parameter names suggested in [Analytics Events](/docs/reference/cpp/group/event-names#group__event__names) (event_names.h) and parameter_names.h respectively. Additional Parameters can be supplied for suggested event types or custom Parameters for custom event types.\n\n[Parameter](/docs/reference/cpp/struct/firebase/analytics/parameter#structfirebase_1_1analytics_1_1_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.\n\n[Parameter](/docs/reference/cpp/struct/firebase/analytics/parameter#structfirebase_1_1analytics_1_1_parameter) string values can be up to 100 characters long.\n\nAn array of this structure is passed to LogEvent in order to associate parameter's of an event ([Parameter::name](/docs/reference/cpp/struct/firebase/analytics/parameter#structfirebase_1_1analytics_1_1_parameter_1aba705f47b129352dfef5d9481cf907d7)) with values ([Parameter::value](/docs/reference/cpp/struct/firebase/analytics/parameter#structfirebase_1_1analytics_1_1_parameter_1aa894317308ad4208f3a195c301005ed6)) where each value can be a double, 64-bit integer or string.\n\nFor example, a game may log an achievement event along with the character the player is using and the level they're currently on:\n\n\n```c++\nusing namespace firebase::analytics;\nint64_t current_level = GetCurrentLevel();\nconst Parameter achievement_parameters[] = {\n Parameter(kParameterAchievementID, \"ultimate_wizard\"),\n Parameter(kParameterCharacter, \"mysterion\"),\n Parameter(kParameterLevel, current_level),\n};\nLogEvent(kEventUnlockAchievement, achievement_parameters,\n sizeof(achievement_parameters) /\n sizeof(achievement_parameters[0]));\n```\n\n\u003cbr /\u003e\n\nPublic attributes \n\nname \n\n```c++\nconst char * firebase::analytics::Parameter::name\n``` \nName of the parameter.\n\n[Parameter](/docs/reference/cpp/struct/firebase/analytics/parameter#structfirebase_1_1analytics_1_1_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. \n\nvalue \n\n```c++\nVariant firebase::analytics::Parameter::value\n``` \nValue of the parameter.\n\nSee [firebase::Variant](/docs/reference/cpp/class/firebase/variant#classfirebase_1_1_variant) for usage information.\n| **Note:** String values can be up to 100 characters long.\n\n\u003cbr /\u003e\n\nPublic functions \n\nParameter \n\n```c++\n firebase::analytics::Parameter::Parameter()\n``` \nConstruct an empty parameter.\n\nThis is provided to allow initialization after construction. \n\nParameter \n\n```c++\n firebase::analytics::Parameter::Parameter(\n const char *parameter_name,\n Variant parameter_value\n)\n``` \nConstruct a parameter.\n\n\u003cbr /\u003e\n\nParameter \n\n```c++\n firebase::analytics::Parameter::Parameter(\n const char *parameter_name,\n int parameter_value\n)\n``` \nConstruct a 64-bit integer parameter.\n\n\u003cbr /\u003e\n\nParameter \n\n```c++\n firebase::analytics::Parameter::Parameter(\n const char *parameter_name,\n int64_t parameter_value\n)\n``` \nConstruct a 64-bit integer parameter.\n\n\u003cbr /\u003e\n\nParameter \n\n```c++\n firebase::analytics::Parameter::Parameter(\n const char *parameter_name,\n double parameter_value\n)\n``` \nConstruct a floating point parameter.\n\n\u003cbr /\u003e\n\nParameter \n\n```c++\n firebase::analytics::Parameter::Parameter(\n const char *parameter_name,\n const char *parameter_value\n)\n``` \nConstruct a string parameter.\n\n\u003cbr /\u003e"]]