iOS版Google Analytics(分析)不派遣活动 [英] Google Analytics for iOS not dispatching events

查看:85
本文介绍了iOS版Google Analytics(分析)不派遣活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用最新的SDK版本,以及注册和发送页面视图的基本代码:

  [[ GANTracker sharedTracker] startTrackerWithAccountID:@UA-MY_ACCOUNT_ID-1
dispatchPeriod:10
delegate:self];

NSError *错误;

if(![[GANTracker sharedTracker] trackPageview:@/ firstpage
withError:& error]){
NSLog(@tracker failed:%@,错误);
}

然而,事件不是从设备或模拟器分派的。也没有错误。当我打开调试标志,我可以看到以下内容:

 调度调用
调度4个事件
[10秒后]
调度称为
...调度员忙于
[10秒后]
调度称为
...调度员繁忙

我的委托方法永远不会被调用:

 eventsFailedDispatch:(NSUInteger)eventsFailedDispatch {
NSLog(@success:%): - (void)trackerDispatchDidComplete:(GANTracker *)tracker
eventsDispatched: d故障:%d,eventsDispatched,eventsFailedDispatch);
}




  • 我尝试创建新的发布商ID,但它也没有帮助。

  • 我在设备和模拟器上连接了互联网。


  • 我使用了发送期 - 将其设置为-1并手动调用分发



没有任何帮助......:( p>

我现在正在为此苦苦挣扎一天...我怎么才能使它工作?

解决方案

我和调度程序有同样的问题(... dispatcher busy)。就我而言,这是因为我通常在后台运行我的应用程序,并且它使用调度程序。当我尝试将设备连接到Xcode以运行和调试应用程序时,控制台向我显示了该消息。因此,解决方案很简单:


  • 在Xcode中停止应用程序

  • 在后台关闭应用程序 / p>

    I'm using the latest SDK version, and the basic code to register and send a page view:

    [[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-MY_ACCOUNT_ID-1"
                                               dispatchPeriod:10
                                                     delegate:self];
    
    NSError *error;
    
    if (![[GANTracker sharedTracker] trackPageview:@"/firstpage"
                                         withError:&error]) {
      NSLog(@"tracker failed: %@",error);
    }
    

    However the events are not dispatched from the device or simulator. There are no errors as well. When i turn on the debug flag, i can see the following:

    dispatch called
    dispatching 4 events
    [after 10 seconds]
    dispatch called
    ...dispatcher was busy
    [after 10 seconds]
    dispatch called
    ...dispatcher was busy
    

    My delegate method never gets called:

    - (void)trackerDispatchDidComplete:(GANTracker *)tracker
                      eventsDispatched:(NSUInteger)eventsDispatched
                  eventsFailedDispatch:(NSUInteger)eventsFailedDispatch{
        NSLog(@"success: %d failures: %d",eventsDispatched,eventsFailedDispatch);
    }
    

    • I tried to create a new publisher ID but it did not help as well.
    • I do have internet connection from the device and simulator
    • I deleted the app before trying.
    • I played with the dispatch period - setting it to -1 and call the dispatch manually

    Nothing helped.... :(

    I'm struggling with this for a day now... how can i make it work?

    解决方案

    I had the same problem with the dispatcher ("...dispatcher was busy"). In my case, it was because I had run my app normally in the background, and it was using the dispatcher. When I tried to connect the device to Xcode to run and debug the app, the console showed me that message. So the solution was easy:

    • Stop the app in Xcode
    • Close the app in background

    That's it.

    这篇关于iOS版Google Analytics(分析)不派遣活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆