For your convenience, the SDK automatically registers your app with Apple for ad network attribution with SKAdNetwork. If you wish to disable this feature, set the value of GOOGLE_ANALYTICS_REGISTRATION_WITH_AD_NETWORK_ENABLED
to NO
(Boolean) in your app’s info.plist file.
After you have configured the FirebaseApp
instance, you can begin to log events with the logEvent()
method.
Certain events are recommended for all apps; others are recommended for specific business types or verticals. You should send suggested events along with their prescribed parameters, to ensure maximum available detail in your reports and to benefit from future features and integrations as they become available. This section demonstrates logging a pre-defined event, for more information on logging events, see Log events.
The following example demonstrates how to log a recommended event to indicate a user has clicked on a specific element in your app:
Analytics.logEvent(AnalyticsEventSelectContent,parameters:[AnalyticsParameterItemID:"id-\(title!)",AnalyticsParameterItemName:title!,AnalyticsParameterContentType:"cont",])
[FIRAnalyticslogEventWithName:kFIREventSelectContentparameters:@{kFIRParameterItemID:[NSStringstringWithFormat:@"id-%@",self.title],kFIRParameterItemName:self.title,kFIRParameterContentType:@"image"}];
To view this event in the Xcode debug console, enable Analytics debugging:
-FIRAnalyticsDebugEnabled
.Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-22 UTC.