Is Google Analytics working?

bool AppDelegate::applicationDidFinishLaunching() {

    sdkbox::PluginFacebook::init();

    sdkbox::PluginGoogleAnalytics::init();
    sdkbox::PluginGoogleAnalytics::startSession();
}

In logcat, it says : class name : --------com/sdkbox/plugin/PluginFacebook----------
But nothing show up for Google Analytics.
I have done exactly every step in document, i also received data from reveicer, but i cant track or even send log info to GA manager.

Im using sdkbox and gaplugin 1.4, cpp.

What am i missing?

Let us have @Ibon chime in. One note, since you are calling init() there is no need to call startSession(). You only need to call startSession() if you call stopSession() at some point.

Google Analytics batch log and send them every 5 min by default. Can you check the logs after 5 mins?

I am in the same boat, I think. Using the latest SDKBox and GoogleAnalytics plugin, it seems no matter what I try I cannot get any data in the Real-Time category to appear. A couple entries did trickle through after a day or so to the other sections but I can’t figure out why real-time does not work. This includes on accounts and properties that are already weeks and months old.

I have tried reinstalling, creating a new Analytics account and property, altering the global_tracker.xml every which way. It seems even when ga_logLevel is set to verbose I don’t see any details about the requests, but the app compiles and runs fine. I tried the Google Analytics example in Android Studio using same tracker ID and the real-time stats showed up immediately so I know it isn’t a time-delay issue but rather something between c2d and SDKBox analytic data. Using latest Google Play Services from Nov. 9 but even tried a very old version to no difference.

Let us have @ibon help us with this. @nite might be able to help too.

In my case I can’t seem to get any logs relating to Google Analytics nor SDKBox despite initializing everything exactly as described. Hmm, is there any way to check that SDKBox is even initializing properly? I get no errors in LogCat but no info either.

Can you try this sample?
https://github.com/sdkbox/sdkbox-ga-sample

I just tested it I was able to see realtime event on both iOS and Android.

I tried the sample (Eclipse build via proj.android) and after updating tracker code I still get no results and can’t locate even a single log message pertaining to SDKBox nor Google Analytics.

EDIT: Actually, I sent APK to a friend and it did detect in real-time. Hmm. I will have to test more, for one thing I am using v2.2.6 for my project and this is built using 3.x but the plugin should be compatible per the docs.

Note that in order to see google analytics tracking real-time correctly, there are couple catch.

  1. Make sure your google analytics account is couple 3-5 days old, newly created accounts seems to have problem showing events
  2. make sure in your filter, include current day, sounds crazy, but we had one user reported that fixes his issue.

Thank you friend, I just edited my response and saw my friend was being tracked and so was I after short wait. I will compare sample to how I’ve implemented it in my app project (which is still 2.2.6) I still don’t know why I can’t see any verbose log data relating to SDKBox / GA. That would surely help me.

In this case, you want to check GA setting make sure your own IP is not been filtered.

sdkbox github samples use startSession/stopSession. Now do we have to use it or not?

Yes, you do have to start and end session as in samples.

If no tracker is set in the configuration, there will be no tracking session. This means that at a later time, a new (or more) tracker can be created. In this case, a explicit call to startSession() should be performed

This is what documentation says. If a tracker set in configuration then sessionStart or sessionStop is not a must. That’s what i get from it. Correct me if i’m wrong.
By the way, i updated skdbox plugins to the latest today. My analytics still works for live tracking for the first time in installation and after that it doesn’t.

Hello @hgokturk

I checked with the sample, however I get tracking data.
If it’s still not working for you.

Is it possible for you to share your code with us !!
We will look into it.

Best,
Pabitra

I was looking for a google analytics solution for awhile and found: https://github.com/Pintea/tiniest-analytics

Much easier to get up and running than the other cocos2d-x solutions I’ve seen. It’s literally 2 files < 100 lines of code that call the Google Analytics event functions via curl.

The only change needed to these files is to include the cocos2d-x curl header instead (ie #include “curl/include/win32/curl/curl.h” or whatever platform)

1 Like

looks good.