使用Swift实施的分析无法正常工作

时间:2015-03-21 19:19:47

标签: ios swift analytics

我使用Google Analytics 3.10跟踪了本教程:http://flyingspheres.blogspot.com/2014/12/swift-google-analytics.html

我认为通过执行所有这些步骤,我会在Google Analytics的实时概述中显示一些数据,但我不知道。一切都是0.

这是我的代码:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.

        GAI.sharedInstance().trackUncaughtExceptions = true
        GAI.sharedInstance().dispatchInterval = 20
        GAI.sharedInstance().logger.logLevel = GAILogLevel.Verbose
        GAI.sharedInstance().trackerWithTrackingId("UA-XXXXXXXX-X")

        //  GAI.sharedInstance().trackUncaughtExceptions = true
        //GAI.sharedInstance().dispatchInterval = 20
      //  GAI.sharedInstance().logger.logLevel = GAILogLevel.Verbose
       // GAI.sharedInstance().trackerWithTrackingId("UA-60935611-2")

        var tracker:GAITracker = GAI.sharedInstance().defaultTracker
        tracker.set(kGAIScreenName, value:"Home Screen")
        tracker.send(GAIDictionaryBuilder.createScreenView().build())

        return true
    }

这是我在控制台中输出的内容:

2015-03-21 20:09:04.748 WzoryStaleFizyczne[4148:217355] VERBOSE: GoogleAnalytics 3.10 +[GAITrackerModel initialize] (GAITrackerModel.m:88): idfa class missing, won't collect idfa
2015-03-21 20:09:04.760 WzoryStaleFizyczne[4148:217427] VERBOSE: GoogleAnalytics 3.10 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:497): Saved hit: {
    parameters =     {
        "&_crc" = 0;
        "&_u" = ".etnoK9L";
        "&_v" = "mi3.1.0";
        "&a" = 359875678;
        "&aid" = "com.krzysztofhadas.WzoryStaleFizyczne";
        "&an" = WzoryStaleFizyczne;
        "&av" = "1.0.1";
        "&cd" = "Home Screen";
        "&cid" = "e77fa8f7-e727-49af-9db9-93a5788d8621";
        "&ds" = app;
        "&sr" = 375x667;
        "&t" = screenview;
        "&tid" = "UA-XXXXXXXX-X";
        "&ul" = en;
        "&v" = 1;
        "&z" = 1148007052490650678;
        gaiVersion = "3.10";
    };
    timestamp = "2015-03-21 19:09:04 +0000";
}
2015-03-21 20:09:04.788 WzoryStaleFizyczne[4148:217355] INFO: GoogleAnalytics 3.10 -[GAIReachabilityChecker reachabilityFlagsChanged:] (GAIReachabilityChecker.m:159): Reachability flags update: 0X000002
2015-03-21 20:09:24.760 WzoryStaleFizyczne[4148:217427] VERBOSE: GoogleAnalytics 3.10 -[GAIRequestBuilder requestGetUrl:payload:] (GAIRequestBuilder.m:195): building URLRequest for https://ssl.google-analytics.com/collect
2015-03-21 20:09:24.761 WzoryStaleFizyczne[4148:217427] VERBOSE: GoogleAnalytics 3.10 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:612): Sending hit(s) GET: https://ssl.google-analytics.com/collect?av=1.0.1&cid=e77fa8f7-e727-49af-9db9-93a5788d8621&tid=UA-60935611-2&cd=Home+Screen&a=359875678&t=screenview&aid=com.krzysztofhadas.WzoryStaleFizyczne&ul=en&_u=.etnoK9L&ds=app&sr=375x667&v=1&_crc=0&an=WzoryStaleFizyczne&_v=mi3.1.0&ht=1426964944756&qt=20003&z=1148007052490650678
2015-03-21 20:09:26.050 WzoryStaleFizyczne[4148:217355] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:208): Hit(s) dispatched: HTTP status -1
2015-03-21 20:09:26.051 WzoryStaleFizyczne[4148:217427] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:509): hit(s) Successfully deleted
2015-03-21 20:09:26.052 WzoryStaleFizyczne[4148:217427] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher didSendHits:] (GAIBatchingDispatcher.m:219): 1 hit(s) sent

我导入了我发送的链接中文本中提到的所有内容和框架。

1 个答案:

答案 0 :(得分:0)

我只需处理这件事。我使用了提供的演示并将其集成到我的应用程序中。

无。 0

然后我今天早上来看看。今天早上工作正常。显然,在谷歌分析的这个方面开始之前,存在一段时间的滞后。