blakgeek / cordova-plugin-flurryanalytics

Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
23 stars 29 forks source link

LogEvent with params doesn't seems to work #7

Closed dongdh closed 8 years ago

dongdh commented 8 years ago

In IOS, I started session, and session is logged in flurry, but all Events I try to log, doesn't show up in flurry. And I don't receive any error from the function call either.

Here is my option to start the session

var options = { version: _this.applicationDM.getFieldData("application_version"), // overrides the version of the app continueSessionSeconds: 5, // how long can the app be paused before a new session is created, must be less than or equal to five for Android devices userId: "XXXXXXXXXXXXXXXXXXXX", // a string with unique id gender: 'm', // valid values are "m", "M", "f" and "F" age: 18, logLevel: 'ERROR', // (VERBOSE, DEBUG, INFO, WARN, ERROR) enableLogging: true, // defaults to false enableEventLogging: true, // should every event show up the app's log, defaults to true enableCrashReporting: true, // should app crashes be recorded in flurry, defaults to false, iOS only enableBackgroundSessions: true, // should the session continue when the app is the background, defaults to false, iOS only reportSessionsOnClose: true, // should data be pushed to flurry when the app closes, defaults to true, iOS only reportSessionsOnPause: true // should data be pushed to flurry when the app is paused, defaults to true, iOS only };

dongdh commented 8 years ago

Tested some more,

IOS version: session and user is logged in flurry, but events are not. Android version: event is logged in flurry, but no statistics of session and users.

blakgeek commented 8 years ago

It takes time for the stats and events to show up in flurry. I think they say up to 24 hours. The longest delay I've seen is about 4 hours. Also the events are only sent after you end a session so make sure you have exited the app.

On Wednesday, October 21, 2015, dongdh notifications@github.com wrote:

Tested some more,

IOS version: session and user is logged in flurry, but events are not. Android version: event is logged in flurry, but no statistics of session and users.

— Reply to this email directly or view it on GitHub https://github.com/blakgeek/cordova-plugin-flurryanalytics/issues/7#issuecomment-149876111 .

Check out my games on www.bggamecentral.com or download them from the App Stores https://itunes.apple.com/us/artist/henry-lawton/id895605107 [image: Get it on Google Play] https://play.google.com/store/apps/developer?id=BG+Games

dongdh commented 8 years ago

I did that, and waited several days, android log event in like 20 min. but android never log any session. Ios log session after like 8 hours, but no event is ever logged.

blakgeek commented 8 years ago

I'd need to see your code. Also verify that that you're using the correct app id for your iOS app. I don't think you can share the same id across platforms.

On Wed, Oct 21, 2015 at 1:16 PM, dongdh notifications@github.com wrote:

I did that, and waited several days, android log event in like 20 min. but android never log any session. Ios log session after like 8 hours, but no event is ever logged.

— Reply to this email directly or view it on GitHub https://github.com/blakgeek/cordova-plugin-flurryanalytics/issues/7#issuecomment-149966787 .

Check out my games on www.bggamecentral.com or download them from the App Stores https://itunes.apple.com/us/artist/henry-lawton/id895605107 [image: Get it on Google Play] https://play.google.com/store/apps/developer?id=BG+Games

dongdh commented 8 years ago

I have different code for iOS app and android app.

Today I received android sessions too, and with event, so android version works perfectly.

But IOS, it just doesn't register event, but it does register number of sessions.

here is the way I am using it

loadFlurry: function(callback) { //ionic bundle is loaded in the beginning var _this = this; var deployed_path = _this.moduleDM.getFieldData("deployed_path"); //load flurry depends on the platform var key = null; if (G_UTIL.isIOS()) { key = _this.storageService.getItem("flurry_ios_key"); } else { key = _this.storageService.getItem("flurry_android_key"); } var options = { version: _this.applicationDM.getFieldData("application_version"), // overrides the version of the app continueSessionSeconds: 2, // how long can the app be paused before a new session is created, must be less than or equal to five for Android devices userId: _this.applicationDM.getFieldData("installation_id"), gender: 'm', // valid values are "m", "M", "f" and "F" age: 18, logLevel: 'VERBOSE', // (VERBOSE, DEBUG, INFO, WARN, ERROR) enableLogging: true, // defaults to false enableEventLogging: true, // should every event show up the app's log, defaults to true enableCrashReporting: true, // should app crashes be recorded in flurry, defaults to false, iOS only enableBackgroundSessions: false, // should the session continue when the app is the background, defaults to false, iOS only reportSessionsOnClose: true, // should data be pushed to flurry when the app closes, defaults to true, iOS only reportSessionsOnPause: true // should data be pushed to flurry when the app is paused, defaults to true, iOS only };

            //initialize flurry
            if (typeof FlurryAnalytics !== 'undefined') {
                _this.flurry = new FlurryAnalytics();
                _this.flurry.init(
                    key, options,
                    function() {
                        _this.info("Flurry initialized");
                        if (callback) {
                            callback(true);
                        }
                    },
                    function(err) {
                        _this.error("Error initialize flurry");
                        if (callback) {
                            callback(false);
                        }
                    }
                );
            } else {
                _this.flurry = null;
                _this.info("FlurryAnalytics not existing");
                if (callback) {
                    callback(false);
                }
            }
        }

this is the initialize function, that initialize Flurry plugin

logEvent: function(eventname, eventparam) { var _this = this; if (this.flurry) { if (eventparam != null) { this.flurry.logEvent(eventname, eventparam, function() { _this.info("Done logEvent "+eventname); }, function(err) { _this.error("Error log logEvent "+JSON.stringify(err)); } ); } else { this.flurry.logEvent(eventname, function() { _this.info("Done logEvent "+eventname); }, function(err) { _this.error("Error log logEvent "+JSON.stringify(err)); } ); } } },

this is the logEvent function.

this.event_changePage = "openPage";

navigateTo: function(fromUrl, toUrl, params) { var eventParam = null; this.logEvent(this.event_changePage, eventParam); },

this is the function I call to log the event,

dongdh commented 8 years ago

2015-10-22 10:22:37.318 Lunchback[3656:218544] Logging Event no parameters openPage 2015-10-22 10:22:37.318 Lunchback[3656:235780] FlurrySession: Attempting to record Event eventName[openPage] with parameters[(null)] 2015-10-22 10:22:37.319 Lunchback[3656:218544] Logging Event result <CDVPluginResult: 0x7fa31aea7170> 2015-10-22 10:22:37.319 Lunchback[3656:235780] FlurrySession: Event count for eventName[openPage] updated to count[1] 2015-10-22 10:22:37.319 Lunchback[3656:235780] FlurrySession: Recording event eventName[openPage] with parameters[(null)] complete 2015-10-22 10:22:37.319 Lunchback[3656:218544] system.subservice.FlurryAnalyticHandler(INFO) : Done logEvent openPage 2015-10-22 10:22:40.485 Lunchback[3656:235790] FlurrySession: Attempting to record Event eventName[openPage] with parameters[(null)] 2015-10-22 10:22:40.485 Lunchback[3656:218544] Logging Event no parameters openPage 2015-10-22 10:22:40.485 Lunchback[3656:218544] Logging Event result <CDVPluginResult: 0x7fa31c8af680> 2015-10-22 10:22:40.485 Lunchback[3656:235790] FlurrySession: Event count for eventName[openPage] updated to count[2] 2015-10-22 10:22:40.485 Lunchback[3656:235790] FlurrySession: Recording event eventName[openPage] with parameters[(null)] complete 2015-10-22 10:22:40.486 Lunchback[3656:218544] system.subservice.FlurryAnalyticHandler(INFO) : Done logEvent openPage 2015-10-22 10:22:45.852 Lunchback[3656:218544] FlurryPulseEventController: pause session called 2015-10-22 10:22:45.852 Lunchback[3656:235801] FlurrySession: Pause session with pauseTime[2015-10-22 08:22:45 +0000] 2015-10-22 10:22:45.853 Lunchback[3656:235801] FlurrySession: Finish session with endTime[2015-10-22 08:22:45 +0000] 2015-10-22 10:22:45.853 Lunchback[3656:235801] FlurrySession: ending all unterminated timed events with _endTime[2015-10-22 08:22:45 +0000]... 2015-10-22 10:22:45.854 Lunchback[3656:235801] FlurrySession: ...finished ending un-ended timed events. 2015-10-22 10:22:45.855 Lunchback[3656:235801] FlurrySession: Sending sessions to server, include current YES 2015-10-22 10:22:45.855 Lunchback[3656:235801] -[NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000ca3 2015-10-22 10:22:45.856 Lunchback[3656:235801] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryPropertiesData-1020897653_162.archive 2015-10-22 10:22:45.859 Lunchback[3656:235801] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryCkData-1020897653_162.archive 2015-10-22 10:22:45.862 Lunchback[3656:235801] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryPersistentUrlsData-1020897653_162.archive 2015-10-22 10:22:45.864 Lunchback[3656:235801] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryPersistenPulseUrlsData-1020897653_162.archive 2015-10-22 10:22:45.866 Lunchback[3656:235801] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryPersistenPulsePrepUrlsData-1020897653_162.archive 2015-10-22 10:22:50.719 Lunchback[3656:218544] locationManager::didFailWithError (null) 2015-10-22 10:22:51.154 Lunchback[3656:218544] active 2015-10-22 10:22:51.154 Lunchback[3656:218544] Flurry: Background session enabled[0] 2015-10-22 10:22:51.154 Lunchback[3656:235780] FlurrySession: Add session with startTime[2015-10-22 08:20:59 +0000] to saved sessions 2015-10-22 10:22:51.154 Lunchback[3656:218544] Flurry: setUserID[testuseridinstring] 2015-10-22 10:22:51.154 Lunchback[3656:218544] Flurry: setGender[m] 2015-10-22 10:22:51.155 Lunchback[3656:235780] -[NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000ca3 2015-10-22 10:22:51.155 Lunchback[3656:235780] +[FlurrySession addToSavedSessions:]: exception -[NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000ca3 2015-10-22 10:22:51.155 Lunchback[3656:235780] FlurrySession: Event logging enabled[1] 2015-10-22 10:22:51.155 Lunchback[3656:235780] FlurrySession: Session reports on close enabled[1] 2015-10-22 10:22:51.155 Lunchback[3656:235780] FlurrySession: Session reports on pause enabled[0] 2015-10-22 10:22:51.156 Lunchback[3656:235780] FlurrySession: Crash reporting enabled[0] 2015-10-22 10:22:51.181 Lunchback[3656:235780] FlurrySession: Initialized session from scratch with startTime[2015-10-22 08:22:51 +0000] 2015-10-22 10:22:51.182 Lunchback[3656:235780] FlurrySession: Created active session with API[ZHGY9Y22NNV94VX47FH9] 2015-10-22 10:22:51.182 Lunchback[3656:235780] FlurrySession: dealloc session 2015-10-22 10:22:51.182 Lunchback[3656:235780] FlurrySession: Session reports on close enabled[1] 2015-10-22 10:22:51.182 Lunchback[3656:235780] FlurrySession: Session reports on pause enabled[1] 2015-10-22 10:22:51.182 Lunchback[3656:235780] FlurrySession: Event logging enabled[1] 2015-10-22 10:22:51.182 Lunchback[3656:235780] FlurrySession: Crash reporting enabled[1] 2015-10-22 10:22:51.183 Lunchback[3656:235780] FlurrySession: set age to [1996-12-31 23:00:00 +0000] 2015-10-22 10:22:51.183 Lunchback[3656:235780] FlurrySession: Set userID[testuseridinstring] 2015-10-22 10:22:51.183 Lunchback[3656:235780] FlurrySession: given gender [m], _gender = [1] 2015-10-22 10:22:51.185 Lunchback[3656:218544] FlurrySession: Initial timestamp[2015-10-20 13:57:21 +0000] from secure source 2015-10-22 10:22:51.185 Lunchback[3656:218544] FlurryPulseEventController: app resuming 2015-10-22 10:22:51.185 Lunchback[3656:235780] Native Debug Log: ad_fetch = 0, ad_requests = 0, ads_returned = 0, ad_ready = 0, Impression fired = 0 2015-10-22 10:22:51.185 Lunchback[3656:218544] FlurrySession: networkStatusChanged to reachable 2015-10-22 10:22:51.185 Lunchback[3656:235780] FlurrySession: Sending sessions to server, include current YES 2015-10-22 10:22:51.186 Lunchback[3656:235780] -[NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000ca3 2015-10-22 10:22:57.148 Lunchback[3656:218544] FlurryPulseEventController: pause session called 2015-10-22 10:22:57.148 Lunchback[3656:236161] FlurrySession: Pause session with pauseTime[2015-10-22 08:22:57 +0000] 2015-10-22 10:22:57.148 Lunchback[3656:236161] FlurrySession: Finish session with endTime[2015-10-22 08:22:57 +0000] 2015-10-22 10:22:57.149 Lunchback[3656:236161] FlurrySession: ending all unterminated timed events with _endTime[2015-10-22 08:22:57 +0000]... 2015-10-22 10:22:57.149 Lunchback[3656:236161] FlurrySession: ...finished ending un-ended timed events. 2015-10-22 10:22:57.150 Lunchback[3656:236161] FlurrySession: Sending sessions to server, include current YES 2015-10-22 10:22:57.150 Lunchback[3656:236161] -[__NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000ca3 2015-10-22 10:22:57.151 Lunchback[3656:236161] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryPropertiesData-1020897653_162.archive 2015-10-22 10:22:57.154 Lunchback[3656:236161] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryCkData-1020897653_162.archive 2015-10-22 10:22:57.156 Lunchback[3656:236161] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryPersistentUrlsData-1020897653_162.archive 2015-10-22 10:22:57.158 Lunchback[3656:236161] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryPersistenPulseUrlsData-1020897653_162.archive 2015-10-22 10:22:57.160 Lunchback[3656:236161] -[FlurryGlobalVariableStorage getPersistentFilePath:]: /Users/huadon/Library/Developer/CoreSimulator/Devices/DA0E7940-3352-4928-A819-1973C4749E38/data/Containers/Data/Application/95C16D49-477A-4B74-803D-18A9406CFABF/Library/Application Support/FlurryFiles/.flurryPersistenPulsePrepUrlsData-1020897653_162.archive

here are some flurry log, I added some custom log into the code too.

dongdh commented 8 years ago

Ok, seems I never get any events log inside of IOS emulator, when I tested from a real device, it logs after like more than 30 hours, weird iOS logs so slow, but android log eventlog like after 20 min.