2014-10-17 73 views
4

我在我的應用中遇到Google Analytics問題。該網站似乎沒有收到任何數據,但該應用程序似乎發送它的權利。我遵循這個Ray Wenderlich教程,以及您運行該應用程序的位置,實時概覽中應該有1位訪問者。它口口聲聲說0Google Analytics(分析)未收到數據

我AppDelegate.m

[GAI sharedInstance].trackUncaughtExceptions = YES; 
[GAI sharedInstance].dispatchInterval = 20; 
[[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose]; 
[[GAI sharedInstance] trackerWithTrackingId:@"UA-********-2"]; 

我ViewController.m

- (void)viewDidLoad 
{ 
    [super viewDidLoad];- 
    self.screenName = @"ScreenZero"; 
//more 
} 

我的控制檯

2014-10-17 15:07:52.479 Wheels[25548:2342406] idfa class missing, won't collect idfa 
2014-10-17 15:07:52.513 Wheels[25548:2342437] CoreData: warning: Unable to load class named 'GAIProperty' for entity 'GAIProperty'. Class not found, using default NSManagedObject instead. 
2014-10-17 15:07:52.923 Wheels[25548:2342406] INFO: GoogleAnalytics 3.09 -[GAIReachabilityChecker reachabilityFlagsChanged:] (GAIReachabilityChecker.m:159): Reachability flags update: 0X000002 
2014-10-17 15:07:52.962 Wheels[25548:2342437] CoreData: warning: Unable to load class named 'GAIHit' for entity 'GAIHit'. Class not found, using default NSManagedObject instead. 
2014-10-17 15:07:52.978 Wheels[25548:2342437] VERBOSE: GoogleAnalytics 3.09 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:431): Saved hit: { 
    parameters =  { 
     "&_crc" = 0; 
     "&_u" = ".etno"; 
     "&_v" = "mi3.0.9"; 
     "&a" = 730280959; 
     "&aid" = "com.samvandamme.Wheels"; 
     "&an" = Wheels; 
     "&av" = "0.1"; 
     "&cd" = ScreenZero; 
     "&cid" = "7deb1f6d-3407-47e6-8303-7bc6305cd706"; 
     "&sr" = 1024x768; 
     "&t" = appview; 
     "&tid" = "UA-********-2"; 
     "&ul" = en; 
     "&v" = 1; 
     "&z" = 15854684929669144728; 
     gaiVersion = "3.09"; 
    }; 
    timestamp = "2014-10-17 13:07:52 +0000"; 
} 
2014-10-17 15:08:12.537 Wheels[25548:2342437] VERBOSE: GoogleAnalytics 3.09 -[GAIRequestBuilder requestGetUrl:payload:] (GAIRequestBuilder.m:195): building URLRequest for https://ssl.google-analytics.com/collect 
2014-10-17 15:08:12.538 Wheels[25548:2342437] VERBOSE: GoogleAnalytics 3.09 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:536): Sending hit(s) GET: https://ssl.google-analytics.com/collect?av=0.1&a=730280959&cd=ScreenZero&t=appview&_crc=0&ul=en&_u=.etno&tid=UA-********-2&cid=7deb1f6d-3407-47e6-8303-7bc6305cd706&sr=1024x768&v=1&aid=com.samvandamme.Wheels&an=Wheels&_v=mi3.0.9&ht=1413551272962&qt=19574&z=15854684929669144728 
2014-10-17 15:08:12.815 Wheels[25548:2342406] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher didSendHits:response:data:error:completionHandler:] (GAIBatchingDispatcher.m:161): Hit(s) dispatched: HTTP status 200 
2014-10-17 15:08:12.816 Wheels[25548:2342437] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:443): hit(s) Successfully dispatched 
2014-10-17 15:08:12.821 Wheels[25548:2342437] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher didSendHits:sendMore:] (GAIBatchingDispatcher.m:174): 1 hit(s) sent 

我的谷歌Analytics(分析) Problem

因此沒有任何東西會被髮送到GA。有任何想法嗎?

+0

你有沒有找到任何解決方案,@Yoko?我有同樣的問題! – 2014-10-24 15:17:26

+0

奇怪的是:我剛剛檢查了Google Analytics,我的數據開始工作。即使是實時。不知道什麼是錯誤的原因,我沒有做任何調整...給我發一條消息與你的foocode,我會檢查它與我的任何差異。 – Yoko 2014-10-24 15:32:26

回答

1

我遇到了類似的問題,但我不認爲它與丟失的庫有關。看起來您的核心數據類可能會丟失。要解決這個問題,請嘗試導入框架並讓我知道它是如何發生的。

嘗試這樣做:

Go to: Build Phases > Link Binary With Libraries > (Click the plus button) > Search for CoreData.Framework 
+0

我在最初就做到了,沒有運氣...... – Yoko 2014-10-17 13:52:15

+0

我發現這個鏈接:https://code.google.com/p/analytics-issues/issues/detail?id=486 – SuperKevin 2014-10-17 13:59:04

+0

看來警告是無害的,並將在未來的SDK版本中修復。這仍然不能解釋爲什麼它不起作用。當我試圖解決我自己的問題時,我會繼續尋找。 – SuperKevin 2014-10-17 13:59:47

0

這裏是我的解決方案

如果你的Xcode 6.1與iOS SDK 8.1。 然後選擇您的目標部署目標到7.0。 在項目的iOS部署到8.1

比鏈接檔案,請不要拖放。 (libAdIdAccess.a和libGoogleAnalyticsServices.a) 轉至目標 - >將軍 - >添加框架並添加並複製檔案到您的文件夾。 Pic 1

比生成設置轉到其他連接器標誌和添加-ObjC Pic 2

,並在App委託添加這didFinishLaunching方法停用IDFA:

ID跟蹤= [[GAI sharedInstance] defaultTracker]; tracker.allowIDFACollection = NO;

這適用於我,並刪除所有錯誤和GA收到的數據。

+0

allowIDFACollection = NO沒有幫助。 – Dmitry 2014-11-22 13:04:20

+1

有時候分析服務器很慢。幾個小時後,靜態圖已經在查找。我已經切換TrackingId:@「UA - ******** - 2」];到我的另一個應用程序正確的作品。你可以看到你的代碼工作。我認爲這是一個分析問題。 – Nachtfux 2014-12-14 10:12:28

0

只需設置

[[GAI sharedInstance] setDryRun:NO]; 
0

此警告犯規效果GA過程中,你仍然會得到你的GA門戶網站的數據。

1

我正在通過相同的問題,對我來說,我嘗試過:

Google iOS SDK 3。12

-(void)setupGoogleAnalytics { 
     //Start Google Analytics 
     NSDictionary *appDefaults = @{kAllowTracking: @(YES)}; 
     [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; 
     // User must be able to opt out of tracking 
     [GAI sharedInstance].optOut = 
     ![[NSUserDefaults standardUserDefaults] boolForKey:kAllowTracking]; 

     self.tracker = [[GAI sharedInstance] trackerWithName:@"App name" 
                trackingId:@"UA-XXXXX"]; 
     [self.tracker set:kGAIScreenName value:@"Begin"]; 

     [self.tracker send:[[GAIDictionaryBuilder createScreenView] build]]; 
     // Optional: set Google Analytics dispatch interval to e.g. 20 seconds. 
     [GAI sharedInstance].dispatchInterval = 20; 
     // Optional: set Logger to VERBOSE for debug information. 
     [[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose]; 

     [[GAI sharedInstance] dispatch]; 


    } 

有了上面塊,我可以測試在調試模式下的設備GA實時頁面運行的實施。也許你必須等待30秒或更長時間,但爲我工作。

相關問題