What is the simpler way to track clicks and screen views of my app created with tiggzi? Any interface with Google Analytics or other web services?
What is the simpler way to track clicks and screen views of my app created with tiggzi? Any interface with Google Analytics or other web services?
I was able to track a screen if I embed google analytics code inside a html panel:
code
<head>
<script type="text/javascript">
var _gaq = _gaq || [];
gaq.push(['setAccount', 'XX-XXXXXX-X']);
gaq.push(['trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
/code
but this will only work within the web-based Tiggzi test app and not the .apk package. When I look inside the Eclipse code generated, I see my app screens are generated as html, so google analytics should work, am I missing something?
It should work in the native (hybrid PhoneGap) app as well.
I found a workaround that works on .apk, only problem is that every action is seen by GoogleAnalytics as a new user:
code
new Image().src='http://nojsstats.appspot.com/UA-XXXXX-1/'+Math.random();
/code
You can add this single line as part of any "Run Custom Javascript" code and Google will track users. Just change XXXXX with your googleAnalytics code.
Any suggestion on how to implement the full Google Analytics so that I can have a better idea of what users are doing on my app?
PS: you can create different UA number ID that will track different actions, still not ideal, but it a working solution
What do you mean by "full Google Analytics"?
one of the many event you can track with googleAnalytics is trackPageview, but you can also trackEvent, sets goals, etc.
In my app I"d like to just setup googleAnalytics for tracking pages views and still retain the user session so that each click in correctly assigned to user. My current working code does not allow that (see my new Image line above). For some reason once the app is packaged into a .apk I loose the ability to use the HTML panel that works fine within the web-based test page.
This might help: http://stackoverflow.com/questions/80....
To usethe plug-in, you would have to export the app source and install the plug-in manually for now.