使用 Flurry Analytics 跟踪 page/screen 次观看

Tracking page/screen views with Flurry Analytics

我刚刚将 Flurry 添加到我的项目中,有些事情不是很清楚。例如,我想跟踪 ViewController1ViewController2,我该如何完成?我应该将以下代码添加到我的 AppDelegate 的 didFinishLaunchingWithOptions: 中,它准备好了吗?或者我需要在每个视图控制器的 viewWillAppear: 中设置 logAllPageViewsForTarget:

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

   [Flurry startSession:@"sampleID"];

    UIViewController *viewController1 =
    [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]instantiateViewControllerWithIdentifier:@"storyboardIDofViewController1"];

    UIViewController *viewController2 =
    [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]instantiateViewControllerWithIdentifier:@"storyboardIDofViewController2"];


    [Flurry logAllPageViewsForTarget:viewController1];
    [Flurry logAllPageViewsForTarget:viewController2];

return yes;
}

我什么时候需要打电话给stopLogPageViewsForTarget:?当用户关闭应用程序时总是需要它,或者它在实践中的功能是什么?

实际上我在 AppDelegate 中使用 logAllPageViewsForTarget:,但是在我的管理面板中,当我打开 Page Views 部分时,我收到以下消息:

You are not currently tracking Page View data. Page View tracking is an optional part of the Flurry SDK that allows you to report the number of page views generated by your users for the purpose of tracking advertising. Since the definition of Page View differs for each application, the Flurry SDK cannot track these for you automatically. Instead, you need to add the appropriate integration points to track page views as they pertain to your application.

我是不是漏掉了什么重要的东西?

logAllPageViewsForTarget:(id) 不跟踪特定的观看次数。

来自Flurry Docs

This method increments the page view count for a session based on traversing a UINavigationController or UITabBarController. The page view count is only a counter for the number of transitions in your app. It does not associate a name with the page count. To associate a name with a count of occurences see logEvent:.

因此,如果您想要跟踪特定视图控制器的特定页面浏览量,则必须使用 Flurry 事件。

例如:

[Flurry logEvent:@"VC1_Viewed"];

查看 Flurry Events 了解详细信息。