26

I wanted to add some analytics functionnalities to my app so I created an account on Flurry and added their SDK to my project. Then I logged some events, normal events and timed ones.

Until here nothing special :) But even after 2 days I can't see any of these events in Flurry's dashboard. I can see the number of sessions so I guess that my app is actually sending something. But no events.

Any idea? I didn't do anything exotic about the code, I register with my ID (which is correct according to that i said previously)

[FlurryAnalytics startSession:flurryKey];

and logged events using :

[FlurryAnalytics logEvent:@"MyEvent"];
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Thomas Castel
  • 553
  • 1
  • 6
  • 11

5 Answers5

29

In addition to the setup, it is crucial to understand how Flurry logs the events. Thanks to some of the comments, I ran some tests in debug mode. You turn it on via:

[Flurry setDebugLogEnabled:YES];

When my app launches, it sets up the user id and some pageView logging. Here is the log output:

    2013-05-27 12:19:00.636 MyApp[8492:907] Flurry: Starting session on Agent Version [115] 
    2013-05-27 12:19:00.659 MyApp[8492:907] Flurry: setUserID[<cut>]
    2013-05-27 12:19:00.684 MyApp[8492:120b] FlurrySession: Add session with startTime[2013-05-27 15:46:22 +0000] to saved sessions
    2013-05-27 12:19:00.704 MyApp[8492:120b] FlurrySession: Add crashed former session
    2013-05-27 12:19:00.713 MyApp[8492:120b] FlurrySession: Event logging enabled[1]
    2013-05-27 12:19:00.714 MyApp[8492:120b] FlurrySession: Session reports on close enabled[1]
    2013-05-27 12:19:00.715 MyApp[8492:120b] FlurrySession: Session reports on pause enabled[0]
    2013-05-27 12:19:00.716 MyApp[8492:120b] FlurrySession: Crash reporting enabled[0]
    2013-05-27 12:19:00.717 MyApp[8492:120b] FlurrySession: set pushToken [(null)], _pushToken = [(null)]
    2013-05-27 12:19:00.719 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
    2013-05-27 12:19:00.720 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
    2013-05-27 12:19:00.736 MyApp[8492:120b] FlurrySession: Initialized session from scratch with startTime[2013-05-27 16:19:00 +0000]
    2013-05-27 12:19:00.737 MyApp[8492:120b] FlurrySession: Created active session with API[<cut>]
    2013-05-27 12:19:00.738 MyApp[8492:120b] FlurrySession: Session reports on close enabled[1]
    2013-05-27 12:19:00.739 MyApp[8492:120b] FlurrySession: Session reports on pause enabled[1]
    2013-05-27 12:19:00.740 MyApp[8492:120b] FlurrySession: Event logging enabled[1]
    2013-05-27 12:19:00.741 MyApp[8492:120b] FlurrySession: Crash reporting enabled[0]
    2013-05-27 12:19:00.742 MyApp[8492:120b] FlurrySession: Sending sessions to server, include current NO
    2013-05-27 12:19:00.763 MyApp[8492:120b] FlurrySession: Initial timestamp[2013-02-20 00:46:06 +0000] from saved source
    2013-05-27 12:19:00.780 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
    2013-05-27 12:19:01.192 MyApp[8492:120b] Flurry: start background task
    2013-05-27 12:19:01.202 MyApp[8492:120b] FlurrySession: Scheduled send 1 session(s).
    2013-05-27 12:19:01.215 MyApp[8492:120b] FlurrySession: Set userID[<cut>]
    2013-05-27 12:19:01.217 MyApp[8492:120b] FlurrySession: dealloc session
    2013-05-27 12:19:04.857 MyApp[8492:907] FlurrySession: networkStatusChanged to  reachable
    2013-05-27 12:19:05.616 MyApp[8492:907] Flurry: HTTP connection delegate received response[<NSHTTPURLResponse: 0x1c5a1310>]
    2013-05-27 12:19:05.624 MyApp[8492:7f03] FlurrySession: async http response code: 200, id [D1038462-66E2-48AE-8304-83A24B0E26EB]
    2013-05-27 12:19:05.634 MyApp[8492:7f03] Flurry: stop background task

Flurry did send the initial session setup automatically, so you will see the sessions on your analytics page (section above, async http response code: 200 is success). You will notice it says the Add crashed former session. This is because I clicked Stop in XCode and killed the app. This did not allow Flurry to log any events! It shows the event logged, but no send session scheduled:

    2013-05-27 12:19:41.184 MyApp[8492:aa07] FlurrySession: Recording event eventName[Doc Save] with parameters[{myparams = "xyz";
    }] complete

You need to click the Home button first on the device to cause Flurry to actually send the logged event. Once you click Home, you will see this in the log:

    2013-05-27 12:21:15.884 MyApp[8492:a30f] FlurrySession: Pause session with pauseTime[2013-05-27 16:21:15 +0000]
    2013-05-27 12:21:15.885 MyApp[8492:a30f] FlurrySession: Finish session with endTime[2013-05-27 16:21:15 +0000]
    2013-05-27 12:21:15.887 MyApp[8492:a30f] FlurrySession: ending all unterminated timed events with _endTime[2013-05-27 16:21:15 +0000]...
    2013-05-27 12:21:15.890 MyApp[8492:a30f] FlurrySession: ...finished ending un-ended timed events.
    2013-05-27 12:21:15.891 MyApp[8492:a30f] FlurrySession: Sending sessions to server, include current YES
    2013-05-27 12:21:15.900 MyApp[8492:a30f] FlurrySession: Initial timestamp[2013-02-20 00:46:06 +0000] from saved source
    2013-05-27 12:21:15.914 MyApp[8492:a30f] Flurry: start background task
    2013-05-27 12:21:15.919 MyApp[8492:a30f] FlurrySession: Scheduled send 1 session(s).
    2013-05-27 12:21:16.729 MyApp[8492:907] Flurry: HTTP connection delegate received response[<NSHTTPURLResponse: 0x1c5ac0b0>]
    2013-05-27 12:21:17.090 MyApp[8492:9c0b] FlurrySession: async http response code: 200, id [BB7CE5C1-D9C4-412F-9A41-6A838174B8FC]
    2013-05-27 12:21:17.293 MyApp[8492:9c0b] Flurry: stop background task

Then you can kill the app with Stop in XCode

ski_squaw
  • 972
  • 1
  • 11
  • 21
  • 2
    One additional thing to watch out for. I had more than 10 parameters in one of my events and the event itself was not logged at all, contrary to the docs. I have a bug report into Flurry support for it. "A maximum of 10 parameter names may be associated with any event. Sending over 10 parameter names with a single event will result in no parameters being logged for that event." – ski_squaw May 28 '13 at 12:46
  • I am having these reported problems. I get Add crashed former session. Mine is also configured to "Session reports on close enabled[1]" and "FlurrySession: Session reports on pause enabled[1]". However when I hit home, nothing is being sent. I watch the console and nothing is going through. the same when I close the app. Re-launching the app only leads to "Add crashed former session" again. Any ideas? – dredful Jul 11 '13 at 00:11
  • Also, I am seeing no "Pause session" and no "Finish session" logging of any kind and I have my logging set to FlurryLogLevelAll. Has anyone seen this? – dredful Jul 11 '13 at 00:13
  • Lastly, I added [Flurry setSessionContinueSeconds:2]; prior to [Flurry startSession:appSettings.flurryAppId]; so that the session should start anew after being paused for 2 seconds. The Flurry code never ends the session no matter how long it is before returning from the background. – dredful Jul 11 '13 at 00:26
  • Did you start up Flurry in your - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method of your AppDelegate? – ski_squaw Jul 11 '13 at 14:49
  • I have my Flurry setup calls in this order: [Flurry setDebugLogEnabled:YES]; [Flurry setAppVersion:appVersion]; [Flurry setUserID:@""]; [Flurry startSession:@""]; – ski_squaw Jul 11 '13 at 14:50
  • [Flurry setDebugLogEnabled:YES]; [Flurry setLogLevel:FlurryLogLevelAll]; [Flurry setCrashReportingEnabled:YES]; [Flurry setSessionContinueSeconds:2]; [Flurry startSession:appSettings.flurryAppId]; [Flurry logEvent:@"Entered app"]; These are all in the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method of your AppDelegate. Still seeing no events of anykind. Just sessions are being logged. Flurry says I am not tracking Page Views and also that I am not tracking Events. – dredful Jul 11 '13 at 17:01
  • 4
    I believe I found the issue. in 4.2.2 there is a new + (void)setBackgroundSessionEnabled:(BOOL)setBackgroundSessionEnabled; which is set to Yes if there are any UIBackgroundModes for your app. Our app uses the GPS in the background. Therefore it will not post when going to the background. When I force [Flurry setBackgroundSessionEnabled:NO]; then it sends up the data when the Home Button is pressed. Not sure how this could ever work otherwise. We don't have a need to use Flurry to update GPS locations so this can work for us now. Thanks for your help! – dredful Jul 12 '13 at 18:53
  • 2
    Thank you @dredful the setBackgroundSessionEnabled was my problem. We also us a background mode and the new 4.2.2 didn't send any data because of it. setting setBackgroundSessionEnabled to NO manually started the data flowing again. – Skabber Jul 23 '13 at 04:12
  • hi @ski_squaw ... I was wondering, if you just call `StartSession`, (even though you're already running), does that just (safely) cause it to send all stored items at that time? So, normally it only sends everything each time, as you say, you hit the home button. But if I force `StartSession` say between laps or every 5 mins or something -- do you happen to know if that "works"? thanks! – Fattie Mar 14 '16 at 03:22
14

I think you are referring to FlurryAnalytics when you say Flurry Events.

OPTION-1:

Please cross check you key and whether you have integrated the latest Flury SDK version for iOS.

OPTION-2:

Please do verify whether you have properly referenced FlurryAnalytics.h and libFlurryAnalytics.a

Also check whether you have added libFlurryAnalytics.a to your Link Binaries to Libraries in your Target Settings

OPTION-3:

Try to login to its website with your login credentials and wait for some more hours.

Moreover, it is not real time service as far as I know. It roughly takes 6-8 hours to show the logged results.

Otherwise you need to contact Flurry Analytics guys as it is really a simple API and there cannot be much of problems that developers could have caused

Hope this helps you.

Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
  • Thanks! Yes it is not really important that it is not real time. But I saw many other thread talking about only few hours (even in their documentation) so I didn't understand why it would take so long for me – Thomas Castel Mar 22 '12 at 12:16
  • @ThomasCastel Yes, I have edited my answer. May be you can cross check one or two other things from my answer. just to make sure everything is fine from your side. – Parth Bhatt Mar 22 '12 at 12:25
  • @ThomasCastel: If it does help then please accept the answer. Because it is really a very straightforward API with very less scope for bugs from developer side. – Parth Bhatt Mar 22 '12 at 12:26
  • I checked this and there must be something sent to their servers since I can see this on the dashboard... I will wait a little more! – Thomas Castel Mar 22 '12 at 12:33
  • 2
    And now I can see the sessions of this morning on the dashboard but still no events... – Thomas Castel Mar 22 '12 at 12:37
  • @ThomasCastel I think you need to cross check if your `logEvent:@"SAMPLE"` is getting called. – Parth Bhatt Mar 22 '12 at 12:39
  • I am sure it is called... It is possible that my events are not sent from my app for some reason? – Thomas Castel Mar 22 '12 at 12:42
  • Ok but I think so, as you might already be having internet connection working right? – Parth Bhatt Mar 22 '12 at 12:43
  • 2
    BTW [FlurryAnalytics setDebugLogEnabled:YES]; show me that everythng is "fine" the logs are sent and the app receive a status code of 200 – Thomas Castel Mar 22 '12 at 12:46
  • @ThomasCastel Ok. So there is no issue with communication of your app with Flurry. But may be it is taking more time than normal for Flurry to start logging your events. Wait for some more time. I am sure it will start showing up the events. – Parth Bhatt Mar 22 '12 at 12:49
  • 19
    Oh wait... I see that could be the problem. It is actually only sending events when the app goes to the background but because I am also debugging I kill the app from xCode to stop it. So the app actually never goes to the background! I ll see in few hours if it was really that. Thank you for spending time to answer me BTW! – Thomas Castel Mar 22 '12 at 12:51
  • How do you add new events in Flurry to track via analytics ? I can't find a link on their website – ArdenDev Jul 08 '12 at 21:59
  • @IphoneDeveloper: It is basically to be created with a unique Event Name from iPhone application itself. Let me know if you need more help. Example: `[FlurryAnalytics logEvent:@"YourDesiredEventName"];` – Parth Bhatt Jul 09 '12 at 08:58
  • @ParthBhatt Thanks for the reply, but I dont see them in Flurry. I only see 15 events that I created. The doc says you can have upto 300 events per application. – ArdenDev Jul 11 '12 at 04:29
  • I've verified all of this and have now waited three days with no events showing up. – Gregory Higley Jul 18 '15 at 02:36
  • @GregoryHigley Please verify with Flurry documentation if you have configured flurry the right way into your application. To be honest, I havent looked into it since 2012. – Parth Bhatt Jul 19 '15 at 15:22
6

If you are using any of backgroundModes you must set:

[Flurry setBackgroundSessionEnabled:NO];

Explanation and description:

https://stackoverflow.com/a/17840667/1041311

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • If you want to track events in background mode you have to keep it set to YES and then explicitly tell Flurry when your session is considered paused/ended by calling the `[Flurry pauseBackgroundSession]` method. – Jens Schwarzer Dec 09 '14 at 10:41
3

I had the same problem and got the following feedback from support@flurry.com:

Any event once deleted is basically black-listed and doesn't get tracked again, unless un-deleted by Flurry admin.

Are you expecting the deleted 55 events to show up? If yes, then since they are deleted, they will not get tracked again.

So I deleted my app from the management section of dev.flurry.com, and created new one with the same name, but it had a new API_KEY. After that all of my 55 events appeared in the flurry analytics's monitor correctly and with all parameters.

Shamsiddin Saidov
  • 2,281
  • 4
  • 23
  • 35
0

One reason why some of new Flurry events are not being logged could be the limit of maximum permitted number of (distinct) flurry events. As explained in this answer, the limit is 300 custom events. If you hit this limit, new event will be simply ignored by Flurry system and, unfortunately, this problem will not be shown in the Xcode log.

If that's the root cause of your problem, here are some suggestions:

  1. Get rid of the events which are no longer needed. You can do this in Flurry admin screen (Manage → Events). Note: You cannot recreate deleted event without getting in touch with Flurry support team (read here).
  2. Redesign your Flurry events. It is better to use one distinct event for a group of similar actions and provide details in the parameters dictionary than creating new (custom) event for each action.
Community
  • 1
  • 1
pjuzeliunas
  • 1,596
  • 1
  • 15
  • 19