Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17076

How to use Flurry in Cocos 3.7 JS project

$
0
0

@efares wrote:

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'm still having some trouble getting the Flurry plugin to work and I have some questions on how to use Flurry.

  1. I am getting a "Uncaught ReferenceError: sdkbox is not defined" Any idea on how to fix this?
  2. 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!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>