Integrate Google Analytics

I need to use Google Analytics in my application. Is this possible? How can I do this? May be somebody already solved this problem. Please, share your experience. [import]uid: 57694 topic_id: 22246 reply_id: 322246[/import]

can’t you use a network API to “post” a google analytics url?

c. [import]uid: 24 topic_id: 22246 reply_id: 88685[/import]

Thank you. If I understood correctly, I need a url with correct parameters, and this should be enough.

I have found similar solution - http://www.developria.com/2011/01/hacking-air-for-android-22-goo.html

And rewrote it. In next several days, I’m going to try it in my project. I hope my problem will be solved.

[code]
module(…, package.seeall)

local ga_utmac = ‘UA-000000-00’
local ga_utmhn = ‘yourdomain.com
local ga_app = ‘yourAppName’

local function trackListener(event)
if event.isError then
print(“Couldn’t track your application.”)
end
end

function init(utmac, domain, appName)
ga_utmac = utmac
ga_utmhn = domain
ga_app = appName
end

function track(page)
local ga_uservar = page
local ga_utmn = tostring(math.random(1000000000, 2147483646))
local ga_cookie = tostring(math.random(10000000, 99999999))
local ga_random = tostring(math.random(1000000000, 2147483646))
local ga_today = os.time( os.date( ‘*t’ ) );

local ga_referer = “http://www.example.com/aboutUs/index.php?var=selected
local ga_utmp=’/app/’ … ga_app … ‘/’ … ga_uservar

local url =
http://www.google-analytics.com/__utm.gif?utmwv=1&utmn=’ … ga_utmn …
‘&utmsr=-&utmsc=-&utmul=-&utmje=0&utmfl=-&utmdt=-&utmhn=’ … ga_utmhn …
‘&utmr=’ … ga_referer …’&utmp=’ … ga_utmp … ‘&utmac=’ … ga_utmac …
‘&utmcc=__utma%3D’ … ga_cookie … ‘.’ … ga_random … ‘.’ … ga_today …
‘.’ … ga_today … ‘.’ … ga_today … ‘.2%3B%2B__utmb%3D’ … ga_cookie …
‘%3B%2B__utmc%3D’ … ga_cookie …’%3B%2B__utmz%3D’ … ga_cookie … ‘.’ … ga_today …
‘.2.2.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B__utmv%3D’
… ga_cookie … ‘.’ … ga_uservar … ‘%3B’

network.request(url, ‘GET’, trackListener)
end
[/code] [import]uid: 57694 topic_id: 22246 reply_id: 89528[/import]

It works!

1. Corona Simulator 128 94.81%
2. Firefox 3 2.22%
3. Chrome 2 1.48%

[import]uid: 57694 topic_id: 22246 reply_id: 89958[/import]

I would like to give a +1 to Google analytics support as an alternative to Flurry. While we could implement basic google analytics calls like above, to build a more robust analytics buffer than only sends when there is a network connection (like Flurry does, right?) is a notable amount of more work. Also, Flurry’s TOS says no apps labelled or marketed to kids can use there services, whereas Google does not have those limitations. [import]uid: 39505 topic_id: 22246 reply_id: 98636[/import]

Greetings Dolgunya !

Thanks for sharing !!! quick ? … How long did it took the stats to show on Google A. ?

Thank You ! [import]uid: 116324 topic_id: 22246 reply_id: 125035[/import]

Greetings Dolgunya !

Thanks for sharing !!! quick ? … How long did it took the stats to show on Google A. ?

Thank You ! [import]uid: 116324 topic_id: 22246 reply_id: 125035[/import]