Flurry Analytics & Events

Hi there,

I am testing Flurry and trying to figure out what is going on with events.  Flurry is reporting new users but not events.   This is being built on a Mac and then executed on an iPhone 5s.  Am I missing something here?

Corona Daily Build 2013.2114

Initialising as follows

build.settings

plugins ={
        [“CoronaProvider.analytics.flurry”]={publisherId = “com.coronalabs”, supportedPlatforms = {iphone = true }},
    }, 

main.lua

–our key from the flurry website for the app
local application_key = “xyz123456789etc”

analytics = require “analytics”

analytics.init( application_key )

–log an event
analytics.logEvent( “Launched”)

Logging an Event with Parameters

analytics.logEvent( “SurveySubmitted”, { Training =  “Completed” } )

 

How long did you wait for events to show up? It can take quite awhile. (I waited a day the first time)

Also, I don’t specify supported platforms in the plugin settings…

Hi RIchard,

I modified my build.settings as follows

settings =  {     plugins =     {         ["CoronaProvider.analytics.flurry"]    =    { publisherId = "com.coronalabs",},     },  

What I have found is that:

-I am using TestFlight to test and that within 30 mins, a new application version will appear on Flurry Site 

-some of my Events have come through within 1 hour (4 events of a total of 10)

-the remaining 4 are missing even though there were triggered

-its random eg in a series of 10 events, 1, 2, 6, 9 are there with the others missing.

All events are called the same way, out of the same module so its weird…

Any other ideas people?

After some testing and community help, I can confirm that the following will work 100% with current builds (tested on 2014.2115)

Note that events do not fire reliably in XCode Simulator or of course the Corona Simulator

If the events work correctly then they will appear within 30 mins on the Flurry site and even show parameter values if passed, however it takes about 14-20 hours for the actual data/stats to appear in reports.  Be patient :slight_smile:

There is some other information on the forums that through me off and I am posting this as I am hoping to save other people some time and pain.

1. Make sure its declared in build.settings    This was a bit finicky for some reason but I have had consistent success with the following.

settings = {      plugins = {           ["CoronaProvider.analytics.flurry"] = {             publisherId = "com.coronalabs",         },     }, ……. rest of build.settings file.

2. Initialise in main.lua (yes I am using a global here… no I don’t do this in production but I didn’t want to make the example more complicated. 
 

--\*\*\*load up flurry --replace our key from the flurry website for the app local application\_key = "ABCDEFGHIJKX123456" —yes this is a global… we should use our custom library or composer library for globals myAnalytics = require "analytics" myAnalytics.init( application\_key ) --log an event myAnalytics.logEvent( "Launched”) —myAnalytics.logEvent( "Launched", {today="something here - see below for more examples"})

3a. Logging a simple Event with Flurry

--flurry log an event myAnalytics.logEvent( "LEVEL01 Launched") 

3a. Logging an Event with Parameters and variables (yes, you can add multiple entries to the myParams table)

--register an event with Flurry and pass some parameters local myParams = {} myParams[“Training"] = myTrainingVar myAnalytics.logEvent("Submitted", myParams)

4. Error Trapping (this also shows how to log as in inline table)

local function myUnhandledErrorListener( event ) myAnalytics.logEvent( "Debug", { errorMessage=event.errorMessage, stackTrace=event.stackTrace } ) end Runtime:addEventListener("unhandledError", myUnhandledErrorListener) 

Hope this helps out.  

Great info! I have a quick question: Is it possible to do this (modifying one of your example)?

–register an event with Flurry and pass some parameters

local myParams = {}

myParams[“Training"] = myTrainingVar

myParams[“GameCounter"] = gameNumber  --add this!

myAnalytics.logEvent(“Submitted”, myParams)

Thanks again.

Mo

Hi Mo,

It sure is.  Just keep in mind that depending on what gameNumber is, I would have a think about the following approach.

Rather than use a variable for games played, use a range - eg 1-5, 6-10, etc. or

if you are not going to have a massive number of events in the app then use the range as an event eg

myAnalytics.logEvent( gameNumberRange)

Make sure that whatever you send has a value (not null) or it can get upset…

Thanks! Great points! 

I appreciate you taking the time.

Mo

Do you have any issues with not all of the events showing up on the flurry website?

I am getting events that could not have occurred if previous events hadn’t also taken place, but the previous events aren’t showing up in the event log.

Example: I get a event called “level.complete[3]” but not “level.complete[2]”. But you can’t access level 3 unless you played level 2. Both are being fired from common level loading code.

My events do all show up when using my example as shown.  Prior to that I was getting random.  I dont its its anything special I did - just might have “fluked” the right combination :slight_smile:

How long did you wait for events to show up? It can take quite awhile. (I waited a day the first time)

Also, I don’t specify supported platforms in the plugin settings…

Hi RIchard,

I modified my build.settings as follows

settings =  {     plugins =     {         ["CoronaProvider.analytics.flurry"]    =    { publisherId = "com.coronalabs",},     },  

What I have found is that:

-I am using TestFlight to test and that within 30 mins, a new application version will appear on Flurry Site 

-some of my Events have come through within 1 hour (4 events of a total of 10)

-the remaining 4 are missing even though there were triggered

-its random eg in a series of 10 events, 1, 2, 6, 9 are there with the others missing.

All events are called the same way, out of the same module so its weird…

Any other ideas people?

After some testing and community help, I can confirm that the following will work 100% with current builds (tested on 2014.2115)

Note that events do not fire reliably in XCode Simulator or of course the Corona Simulator

If the events work correctly then they will appear within 30 mins on the Flurry site and even show parameter values if passed, however it takes about 14-20 hours for the actual data/stats to appear in reports.  Be patient :slight_smile:

There is some other information on the forums that through me off and I am posting this as I am hoping to save other people some time and pain.

1. Make sure its declared in build.settings    This was a bit finicky for some reason but I have had consistent success with the following.

settings = {      plugins = {           ["CoronaProvider.analytics.flurry"] = {             publisherId = "com.coronalabs",         },     }, ……. rest of build.settings file.

2. Initialise in main.lua (yes I am using a global here… no I don’t do this in production but I didn’t want to make the example more complicated. 
 

--\*\*\*load up flurry --replace our key from the flurry website for the app local application\_key = "ABCDEFGHIJKX123456" —yes this is a global… we should use our custom library or composer library for globals myAnalytics = require "analytics" myAnalytics.init( application\_key ) --log an event myAnalytics.logEvent( "Launched”) —myAnalytics.logEvent( "Launched", {today="something here - see below for more examples"})

3a. Logging a simple Event with Flurry

--flurry log an event myAnalytics.logEvent( "LEVEL01 Launched") 

3a. Logging an Event with Parameters and variables (yes, you can add multiple entries to the myParams table)

--register an event with Flurry and pass some parameters local myParams = {} myParams[“Training"] = myTrainingVar myAnalytics.logEvent("Submitted", myParams)

4. Error Trapping (this also shows how to log as in inline table)

local function myUnhandledErrorListener( event ) myAnalytics.logEvent( "Debug", { errorMessage=event.errorMessage, stackTrace=event.stackTrace } ) end Runtime:addEventListener("unhandledError", myUnhandledErrorListener) 

Hope this helps out.  

Great info! I have a quick question: Is it possible to do this (modifying one of your example)?

–register an event with Flurry and pass some parameters

local myParams = {}

myParams[“Training"] = myTrainingVar

myParams[“GameCounter"] = gameNumber  --add this!

myAnalytics.logEvent(“Submitted”, myParams)

Thanks again.

Mo

Hi Mo,

It sure is.  Just keep in mind that depending on what gameNumber is, I would have a think about the following approach.

Rather than use a variable for games played, use a range - eg 1-5, 6-10, etc. or

if you are not going to have a massive number of events in the app then use the range as an event eg

myAnalytics.logEvent( gameNumberRange)

Make sure that whatever you send has a value (not null) or it can get upset…

Thanks! Great points! 

I appreciate you taking the time.

Mo

Do you have any issues with not all of the events showing up on the flurry website?

I am getting events that could not have occurred if previous events hadn’t also taken place, but the previous events aren’t showing up in the event log.

Example: I get a event called “level.complete[3]” but not “level.complete[2]”. But you can’t access level 3 unless you played level 2. Both are being fired from common level loading code.

My events do all show up when using my example as shown.  Prior to that I was getting random.  I dont its its anything special I did - just might have “fluked” the right combination :slight_smile: