Google Analytics iOS SDK 3.12数据在信息中心内不可见

时间:2015-07-02 20:48:17

标签: ios google-analytics

我在应用中实施了Google Analytics 问题是我在Google Analytics信息中心中没有看到任何内容。

以下是我在Xcode中可以看到的日志:('''是我替换的值)

2015-07-02 20:55:28.091 AppName[1619:931478] VERBOSE: GoogleAnalytics 3.12 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:517): Saved hit: {
    parameters =     {
        "&_crc" = 0;
        "&_s" = 51;
        "&_u" = ".oK9L";
        "&_v" = "mi3.1.2";
        "&a" = 1809611894;
        "&aid" = "...";
        "&an" = ...;
        "&av" = "3.0.3";
        "&cd" = Home;
        "&cid" = "...";
        "&dm" = "iPad3,4";
        "&ds" = app;
        "&sr" = 2048x1536;
        "&t" = screenview;
        "&tid" = "...";
        "&ul" = fr;
        "&v" = 1;
        "&z" = 14083819698118597511;
        gaiVersion = "3.12";
    };
    timestamp = "2015-07-02 18:55:28 +0000";
}

2015-07-02 20:55:36.043 AppName[1619:931478] VERBOSE: GoogleAnalytics 3.12 -[GAIRequestBuilder requestPostUrl:payload:compression:] (GAIRequestBuilder.m:167): building URLRequest for https://ssl.google-analytics.com/batch
2015-07-02 20:55:36.045 AppName[1619:931478] VERBOSE: GoogleAnalytics 3.12 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:632): Sending hit(s) POST: https://ssl.google-analytics.com/batch
2015-07-02 20:55:36.077 AppName[1619:931363] INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:226): Hit(s) dispatched: HTTP status 200
2015-07-02 20:55:36.078 AppName[1619:931478] INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:529): hit(s) Successfully deleted
2015-07-02 20:55:36.088 AppName[1619:931478] INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher didSendHits:] (GAIBatchingDispatcher.m:237): 8 hit(s) sent

所以我非常确定分析数据是发送的(某个地方......在服务器上...在太空......)。

但我在Analytics Dashboard中没有看到任何内容。我可以看到我在实时部分的哪个屏幕上,但我没有看到全局屏幕点击。

如果您发现任何错误,请输入以下代码:

// AppDelegate.swift
// Configure tracker from GoogleService-Info.plist.
var configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: \(configureError)")

// Optional: configure GAI options.
var gai = GAI.sharedInstance()
gai.trackUncaughtExceptions = true  // report uncaught exceptions
gai.dispatchInterval = 10
gai.logger.logLevel = GAILogLevel.Verbose  // remove before app release

// Analytics.swift
class Analytics {

    static let sharedInstance = Analytics()

    init() {
        GAI.sharedInstance().trackerWithTrackingId("...")
    }

    func trackView(viewName: String) {
        println(viewName)
        let tracker = GAI.sharedInstance().defaultTracker
        tracker.set(kGAIScreenName, value: viewName)

        var builder = GAIDictionaryBuilder.createScreenView()
        tracker.send(builder.build() as [NSObject : AnyObject])
    }

}

1 个答案:

答案 0 :(得分:0)

简单的答案是你只需要等待 还有其他帖子说明您需要等待48小时,并附带文档链接。我无法在新文档中找到该部分。

对我来说,测试后的第二天就可以获得数据。