If you see it working in simulator then probably your setup is fine.
Have you checked device logs for errors?
If you see it working in simulator then probably your setup is fine.
Have you checked device logs for errors?
Not yet. But no error and perfectly work in simulator. Just not showed up in the analytics
can we check the traffic using simulator only ?
oh, its works now.
i tested in 2 device and its works.
so strage. thanks for our support 
Great 
Hi,
i wondering to enable Display Advertising features for Android.
is that posible ?
https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad
it said to add this lines :
// Get tracker.
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
TrackerName.APP_TRACKER);
// Enable Display Features.
t.enableAdvertisingIdCollection(true);
I doubt it, at least I don’t see any mention of it here https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
i see. because it said its needed in order to show demographic and interest report. 
thanks
You probably need native access for that (enterprise Corona).
I’m guessing you probably need hundreds of thousands of users to get any meaningful age/gender/hobby/etc data from Google since it won’t work for all users.
Yes i think.
Thanks Jonjonsson 
Thanks JonJonsson for this great plugin!
Here’s something to be aware of if you are having a problem with the analytics working fine in the simulator but not working on devices. It is not a problem with the plugin. It is something that can happen in the GA dashboard quite easily if you click on the wrong thing.
When you test in the simulator and look at the Real-time events or Overview in GA, you’ll see something like this:

That means it is working fine from the simulator.
If you happen to click the red-orange square next to DESKTOP or click the 100% bar , GA will create a FILTER to view ONLY Desktop users. Any subsequent testing you do on real mobile/tablets will NOT show up until you dismiss the filter.
Here is what the filter looks like:

Events from Mobile or Tablet devices will not show up until you click the X in the blue button to dismiss the DEVICE CATEGORY: Desktop filter.
This drove me crazy for a couple of hours, so I thought I’d share.
Cheers!
— EDIT : this post and question is no longer valid, data shows up now… seems like it doesn’t track anything from windows simulator, but once I ran it on any device, it started showing up in Analytics dashboard —
Hi Jon,
I created my account on google analytics yesterday (a Mobile App type property), and today I’m trying to get it working in my app using your module.
So far however, I’ve had no luck: no matter what I do, the google analytics console shows me “0 sessions” in Realtime tracking overview.
Is this an error, should it work? Or does your module not give GA the realtime data and I’m just over-concerned? From other apps (fully native professional apps, not corona based) I know the realtime data are usually displayed within 5-10 seconds as soon as I run the app
Here’s the bit of your code I have in my main.lua (I obviously replaced the tracking codes with Xs, but in my code I have the right IDs - checked it about a hundred times.
print("\n\n---------START GOOGLE ANALYTICS PRINTOUT-----------") local ga = require("GoogleAnalytics.ga") ga.init({ isLive = false, testTrackingID = "UA-xxxxxxxx-1", -- \<-- Replace with your tracking code. If code is wrong it fails silently. productionTrackingID = "UA-xxxxxxxx-2", -- \<-- Replace with your tracking code. If code is wrong it fails silently. debug = true, appName = "TSC Calc Test", appVersion = "1.1.4", appID = "com.mcxondev.tsccalc.test", clientID = "CoronaSimulator-" .. math.random( 1,100000) }) ga.enterScene("Main Scene (start app)") print("---------END GOOGLE ANALYTICS PRINTOUT-----------\n\n")
I’m also attaching my terminal output screenshot and the sad view of the google analytics console.
Any tips on what am I doing wrong?
I appreciate any advice you can give me.
Thank you.
Hi Joe,
yes it only takes a couple of secs to show up in the real time stats.
To debug this you can copy the URL you see in the debug console and use it in a browser, it should show up as a hit in real time stats.
Paste a copy of the URL here and I’ll test it with my test ID as well.
Well no worries, like I said in the edit on top of my post - it only doesn’t work in the windows simulator, but when I ran the same build on a device, the analytics are showing up in realtime.
… except on my older HTC Desire S phone :)
I Don’t know why, I tested 7 different devices, and every single one of them reports ok, but the HTC phone I have with a custom (but HTC based) ROM doesn’t seem to send anything - or at least it doesn’t show up in analytics at all, realtime, or the historical (previous day for now)
I’m trying to get some more HTC devices to try if it’s just this one, or if it’s a HTC linked problem.
weird though…
That is weird! It’s just a POST network request. Very basic stuff, should just work everywhere one would think 
This is great, thanks jonjonsson!
My client is asking me to implement Google Tag Manager tracking into a corona app. Any ideas on how that could be done?
This looks promising. What happens if the user doesn’t have internet? Does it give an error?
No there is no error. Offline events are stored in memory. If the app goes online these events are sent. If the app is released from OS memory the events are lost.
Excellent. I’m in the process of incoroporating it now but I have a question. If you leave the isLive as false, will it record events?
I’m trying to test it and I know it takes some time for the results to appear in Google but I wanted to make sure that I’m actually SENDING events.
In the previewer I’m getting some errors, but I assume that’s because it’s not on a device.
If you leave the isLive as false, will it record events?
Yes but on your testTrackingID. You can see real time analytics within few seconds.
In the previewer I’m getting some errors, but I assume that’s because it’s not on a device.
Events are tracked on simulator just as it were a real device (but only on testTrackingID, even if isLive = true).
What kind of errors?