Hi,
I followed both instructions SDKBOX installer and Cocos Helper (JavaScript) and then followed the instructions to install Flurry Analytics and looked at Flurry sample but I have a question on how to use Flurry.
Where am I supposed to put all of this code:
// Flurry Analytics
this.session_created = false
var self = this
// Flurry Event Listener
sdkbox.PluginFlurryAnalytics.setListener({
flurrySessionDidCreateWithInfo: function (info) {
self.session_created = true
var jsonInfo = JSON.parse(info)
console.log("Menu session started")
console.log("APIKey :" + jsonInfo.apiKey + " session id :" + jsonInfo.sessionId);
sdkbox.PluginFlurryAnalytics.logEvent("Log menu session", JSON.stringify({
"eKey1": "eVal1",
"eKey2": "eVal2"
}));
}
});
sdkbox.PluginFlurryAnalytics.init(); // Initialize Flurry Analytics
sdkbox.PluginFlurryAnalytics.startSession(); // Start a Flurry session
sdkbox.PluginFlurryAnalytics.setCrashReportingEnabled(true); // Enable crash reports by Flurry
sdkbox.PluginFlurryAnalytics.logPageView(); // Track a page view during session
I have put it in my app.js file in the ctor: function() {
is this the right spot? And am I supposed to do this for every page of my app? i.e. menu scene and again in play scene?
Thanks!