我已经在我的项目中使用 cocoapods 成功集成了 Google Analytics iOS SDK(使用 Swift 语言)。
- 添加了 Cocoapods(
pod 'Google/Analytics'
) - 生成 GoogleService-Info.plist 文件并将其添加到项目和最后一步
- 在 AppDelegate.swift 中初始化 Google Analytics
var configureError:NSError? GGLContext.sharedInstance().configureWithError(&configureError) assert(configureError == nil, "Error configuring Google services: (configureError)")
- 在 viewdidappear 中添加了屏幕 View 代码
最后在模拟器或设备上运行应用程序后,日志显示如下
3.14 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:226): Hit(s) dispatched: HTTP status -1 2016-07-21 13:05:25.265 HelloWorld[4264:206213] INFO: GoogleAnalytics 3.14 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:529): hit(s) Successfully deleted 2016-07-21 13:05:25.266 HelloWorld[4264:206213] INFO: GoogleAnalytics 3.14 -[GAIBatchingDispatcher didSendHits:] (GAIBatchingDispatcher.m:237): 1 hit(s) sent
但在仪表板(Google Analytics)中没有反射(reflect)出来吗? https://analytics.google.com/analytics/web
请帮忙。
最佳答案
尝试在实时部分进行检查,并在单击按钮时添加一些事件以便在需要测试时能够发送报告 您确定将其添加为移动应用程序吗?如果它作为网络工作,它在报告中会有很长的延迟。
关于ios - Google Analytics Swift - 不显示更新的仪表板报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38500223/