1414
1515#include " analytics/src/windows/analytics_windows.h"
1616#include " app/src/include/firebase/app.h"
17- #include " analytics/src/include/firebase/analytics.h" // Path confirmed to remain as is
17+ #include " analytics/src/include/firebase/analytics.h"
1818#include " analytics/src/common/analytics_common.h"
1919#include " common/src/include/firebase/variant.h"
2020#include " app/src/include/firebase/future.h"
@@ -50,11 +50,6 @@ void Initialize(const App& app) {
5050// Terminates the Analytics desktop API.
5151// Call this function when Analytics is no longer needed to free up resources.
5252void Terminate () {
53- // The underlying Google Analytics C API for Windows does not have an explicit
54- // global termination or shutdown function. Resources like event parameter maps
55- // are managed at the point of their use (e.g., destroyed after logging).
56- // This function is provided for API consistency with other Firebase platforms
57- // and for any future global cleanup needs for the desktop wrapper.
5853 if (g_future_data) {
5954 delete g_future_data;
6055 g_future_data = nullptr ;
@@ -94,11 +89,12 @@ static void ConvertParametersToGAParams(
9489 continue ; // Skip this parameter
9590 } else if (param.value .is_map ()) {
9691 // This block handles parameters that are maps.
97- // Each key-value pair in the map is converted into a GoogleAnalytics_Item,
98- // and all such items are bundled into a GoogleAnalytics_ItemVector,
99- // which is then inserted into the event parameters.
100- // The original map's key becomes the "name" property of the GA_Item,
101- // and the map's value becomes one of "int_value", "double_value", or "string_value".
92+ // Each key-value pair from the input map is converted into a distinct GoogleAnalytics_Item.
93+ // In each such GoogleAnalytics_Item, the original key from the map is used directly
94+ // as the property key, and the original value (which must be a primitive)
95+ // is set as the property's value.
96+ // All these GoogleAnalytics_Items are then bundled into a single
97+ // GoogleAnalytics_ItemVector, which is associated with the original parameter's name.
10298 const std::map<std::string, firebase::Variant>& user_map =
10399 param.value .map_value ();
104100 if (user_map.empty ()) {
@@ -124,8 +120,6 @@ static void ConvertParametersToGAParams(
124120 continue ; // Skip this key-value pair, try next one in map
125121 }
126122
127- // Removed: GoogleAnalytics_Item_InsertString(c_item, "name", key_from_map.c_str());
128-
129123 bool successfully_set_property = false ;
130124 if (value_from_map.is_int64 ()) {
131125 GoogleAnalytics_Item_InsertInt (c_item, key_from_map.c_str (), value_from_map.int64_value ());
@@ -168,7 +162,7 @@ static void ConvertParametersToGAParams(
168162
169163// Logs an event with the given name and parameters.
170164void LogEvent (const char * name,
171- const Parameter* parameters, // firebase::analytics::Parameter
165+ const Parameter* parameters,
172166 size_t number_of_parameters) {
173167 if (name == nullptr || name[0 ] == ' \0 ' ) {
174168 LogError (" Analytics: Event name cannot be null or empty." );
0 commit comments