I just added Flurry to my project and some things are not so clear. As an instance I have ViewController1
and ViewController2
that I would like to track, how can I accomplish it? I should just add the below codes into my AppDelegate's didFinishLaunchingWithOptions:
and it's ready? Or I need to set logAllPageViewsForTarget:
in each view controller's viewWillAppear:
?
- (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;
}
When do I need to call stopLogPageViewsForTarget:
? It's needed always when the user closes the app, or what is it's function in practice?
Actually I'm using logAllPageViewsForTarget:
in my AppDelegate
, but in my admin panel when I open the Page Views
section I get this message:
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.
Am I missed something important?
The logAllPageViewsForTarget:(id)
doesn't track specific view count.
From 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:.
Therefore, if you want you want to track specific page view counts for specific view controllers you will have to use Flurry events.
For example:
[Flurry logEvent:@"VC1_Viewed"];
Check out Flurry Events for detailed info.