ios - Google Analytics iOS 的问题

标签 ios swift google-analytics

我知道有很多关于谷歌分析问题的问题和答案,但对我没有任何帮助。

我已经安装了 google with pods

pod 'GoogleAnalytics'

并将其导入桥接 header 中,并在 appDelegate 中使用此代码

<GoogleAnalytics/GAI.h>
"GAIDictionaryBuilder.h"
guard let gai = GAI.sharedInstance() else {
            assert(false, "Google Analytics not configured correctly")
        }

        GAI.sharedInstance().defaultTracker = gai.tracker(withTrackingId: "UA-109196643-1")
        // Optional: automatically report uncaught exceptions.
        gai.trackUncaughtExceptions = true
        GAI.sharedInstance().dispatchInterval = 20
        GAI.sharedInstance().dispatch { (result) in
            print(result)
        }
        // Optional: set Logger to VERBOSE for debug information.
        // Remove before app release.
        gai.logger.logLevel = .verbose;

这是日志文本

INFO: GoogleAnalytics 3.17 -[GAIBatchingDispatcher hitsForDispatch] (GAIBatchingDispatcher.m:369): No pending hits. INFO: GoogleAnalytics 3.17 -[GAIReachabilityChecker reachabilityFlagsChanged:] (GAIReachabilityChecker.m:161): Reachability flags update: 0X000002

这是我登录屏幕时的日志

GoogleAnalytics 3.17 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:518): Saved hit: { parameters = { "&_crc" = 0; "&_s" = 9; "&_u" = ".npetoK9L"; "&_v" = "mi3.1.7"; "&a" = 1028296819; "&aid" = "******"; "&an" = Mataam; "&av" = "1.0"; "&cid" = "59cc9c6e-be21-4ac8-b6d9-d3beff894dbf"; "&dm" = "x86_64"; "&ds" = app; "&sr" = 1242x2208; "&t" = screenview; "&tid" = "UA-109196643-1"; "&ul" = en; "&v" = 1; "&z" = 15726875618543142345; Login = name; gaiVersion = "3.17"; }; timestamp = "2017-11-11 15:42:53 +0000"; }

所以问题是我没有在分析中获取任何数据,我还设置了 firebase,这可能是问题所在,因为我正在那里获取数据。

最佳答案

我发布了一个新答案,因为这是我的答案并且我添加了更多详细信息:

您可以使用 Firebase SDK 并在您的 Google Analytics 帐户中获取分析。 您只需将它们链接在一起。

按照说明操作:

Link to instructions on Google Help

  1. Sign in to your Google Analytics account.
  2. Click Admin.
  3. In the PROPERTY column, select Create new property from the dropdown menu.
  4. Select Mobile app.
  5. Connect to Firebase. If you do not have a Firebase account, go to firebase.google.com to get started. Once you have completed the setup, return to Google Analytics and complete the above steps.

关于ios - Google Analytics iOS 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47239849/

相关文章:

ios - 有没有办法限制临时或调试 iOS 构建仅在特定时间范围内运行?

ios - 单击自定义 uitableviewcell 中的一个 uibutton 会选择 uitableview 中的多个 uibutton

android - 检测应用程序何时从后台返回

android - Google 任务管理器自定义事件未触发 - Android

ios - 谷歌分析在不同系统机器上崩溃 iOS

ios - 将NSDate保存在核心数据XCode 5.0中

导航栏中的 iOS 分段控件

ios - 如何使用 Swift 在 iOS 中将音频格式从 mp3 转换为 wav?

ios - 多尺寸 CollectionView 单元格

ios - 在 Swift 中使用 SWRevealViewController 手动 segue