2828
2929#if defined(_WIN32)
3030#include < windows.h>
31+
3132#include " analytics_windows.h"
3233#endif // defined(_WIN32)
3334
@@ -101,7 +102,7 @@ void Initialize(const App& app) {
101102 c_options->app_id = current_app_id.c_str ();
102103 c_options->package_name = current_package_name.c_str ();
103104 c_options->analytics_collection_enabled_at_first_launch =
104- g_analytics_collection_enabled;
105+ g_analytics_collection_enabled;
105106
106107 LogInfo (
107108 " Analytics: Initializing Google Analytics C API with App ID: %s, "
@@ -180,13 +181,14 @@ static void ConvertParametersToGAParams(
180181 // ItemVector) are handled.
181182#if defined(_WIN32)
182183 if (g_analytics_module) {
183- // Only log this if we are not in stub mode.
184- LogError (
185- " Analytics: Parameter '%s' has type Vector, which is unsupported for "
186- " event parameters on Desktop. Skipping." ,
187- param.name );
184+ // Only log this if we are not in stub mode.
185+ LogError (
186+ " Analytics: Parameter '%s' has type Vector, which is unsupported "
187+ " for "
188+ " event parameters on Desktop. Skipping." ,
189+ param.name );
188190 }
189- #endif // defined(_WIN32)
191+ #endif // defined(_WIN32)
190192 continue ; // Skip this parameter
191193 } else if (param.value .is_map ()) {
192194 // This block handles parameters that are maps.
@@ -440,11 +442,12 @@ void SetConsent(const std::map<ConsentType, ConsentStatus>& consent_settings) {
440442 // Not supported by the Windows C API.
441443 (void )consent_settings; // Mark as unused
442444#if defined(_WIN32)
443- if (g_analytics_module) {
444- // Only log this if we are not in stub mode.
445- LogWarning (
446- " Analytics: SetConsent() is not supported and has no effect on Desktop." );
447- }
445+ if (g_analytics_module) {
446+ // Only log this if we are not in stub mode.
447+ LogWarning (
448+ " Analytics: SetConsent() is not supported and has no effect on "
449+ " Desktop." );
450+ }
448451#endif // defined(_WIN32)
449452}
450453
@@ -453,12 +456,12 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(
453456 FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
454457 (void )email_address;
455458#if defined(_WIN32)
456- if (g_analytics_module) {
457- // Only log this if we are not in stub mode.
458- LogWarning (
459- " Analytics: InitiateOnDeviceConversionMeasurementWithEmailAddress() is "
460- " not supported and has no effect on Desktop." );
461- }
459+ if (g_analytics_module) {
460+ // Only log this if we are not in stub mode.
461+ LogWarning (
462+ " Analytics: InitiateOnDeviceConversionMeasurementWithEmailAddress() is "
463+ " not supported and has no effect on Desktop." );
464+ }
462465#endif // defined(_WIN32)
463466}
464467
@@ -467,12 +470,12 @@ void InitiateOnDeviceConversionMeasurementWithPhoneNumber(
467470 FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
468471 (void )phone_number;
469472#if defined(_WIN32)
470- if (g_analytics_module) {
471- // Only log this if we are not in stub mode.
472- LogWarning (
473- " Analytics: InitiateOnDeviceConversionMeasurementWithPhoneNumber() is "
474- " not supported and has no effect on Desktop." );
475- }
473+ if (g_analytics_module) {
474+ // Only log this if we are not in stub mode.
475+ LogWarning (
476+ " Analytics: InitiateOnDeviceConversionMeasurementWithPhoneNumber() is "
477+ " not supported and has no effect on Desktop." );
478+ }
476479#endif // defined(_WIN32)
477480}
478481
@@ -481,13 +484,13 @@ void InitiateOnDeviceConversionMeasurementWithHashedEmailAddress(
481484 FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
482485 (void )hashed_email_address;
483486#if defined(_WIN32)
484- if (g_analytics_module) {
485- // Only log this if we are not in stub mode.
486- LogWarning (
487- " Analytics: "
488- " InitiateOnDeviceConversionMeasurementWithHashedEmailAddress() is not "
489- " supported and has no effect on Desktop." );
490- }
487+ if (g_analytics_module) {
488+ // Only log this if we are not in stub mode.
489+ LogWarning (
490+ " Analytics: "
491+ " InitiateOnDeviceConversionMeasurementWithHashedEmailAddress() is not "
492+ " supported and has no effect on Desktop." );
493+ }
491494#endif // defined(_WIN32)
492495}
493496
@@ -496,25 +499,26 @@ void InitiateOnDeviceConversionMeasurementWithHashedPhoneNumber(
496499 FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
497500 (void )hashed_phone_number;
498501#if defined(_WIN32)
499- if (g_analytics_module) {
500- // Only log this if we are not in stub mode.
501- LogWarning (
502- " Analytics: InitiateOnDeviceConversionMeasurementWithHashedPhoneNumber() "
503- " is not supported and has no effect on Desktop." );
504- }
502+ if (g_analytics_module) {
503+ // Only log this if we are not in stub mode.
504+ LogWarning (
505+ " Analytics: "
506+ " InitiateOnDeviceConversionMeasurementWithHashedPhoneNumber() "
507+ " is not supported and has no effect on Desktop." );
508+ }
505509#endif // defined(_WIN32)
506510}
507511
508512void SetSessionTimeoutDuration (int64_t milliseconds) {
509513 FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
510514 (void )milliseconds;
511515#if defined(_WIN32)
512- if (g_analytics_module) {
513- // Only log this if we are not in stub mode.
514- LogWarning (
515- " Analytics: SetSessionTimeoutDuration() is not supported and has no "
516- " effect on Desktop." );
517- }
516+ if (g_analytics_module) {
517+ // Only log this if we are not in stub mode.
518+ LogWarning (
519+ " Analytics: SetSessionTimeoutDuration() is not supported and has no "
520+ " effect on Desktop." );
521+ }
518522#endif // defined(_WIN32)
519523}
520524
@@ -532,11 +536,11 @@ Future<std::string> GetAnalyticsInstanceId() {
532536 api->CompleteWithResult (future_handle, 0 , " " , instance_id);
533537
534538#if defined(_WIN32)
535- if (g_analytics_module) {
536- // Only log this if we are not in stub mode.
537- LogWarning (
538- " Analytics: GetAnalyticsInstanceId() is not supported on Desktop." );
539- }
539+ if (g_analytics_module) {
540+ // Only log this if we are not in stub mode.
541+ LogWarning (
542+ " Analytics: GetAnalyticsInstanceId() is not supported on Desktop." );
543+ }
540544#endif // defined(_WIN32)
541545 return Future<std::string>(api, future_handle.get ());
542546}
@@ -573,7 +577,7 @@ Future<int64_t> GetSessionIdLastResult() {
573577 if (g_analytics_module) {
574578 // Only log this if we are not in stub mode.
575579 LogWarning (
576- " Analytics: GetSessionIdLastResult() is not supported on Desktop." );
580+ " Analytics: GetSessionIdLastResult() is not supported on Desktop." );
577581 }
578582#endif // defined(_WIN32)
579583 return static_cast <const Future<int64_t >&>(
0 commit comments