I've build an ios application that is having static HTML pages. I'm using uiwebview to create container for my HTML pages.
Now I want to use google analytics for my pages. I've downloaded its SDK and it is working. Now I would like to track events on some of buttons on HTML page. If use below code
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<Acc no>']);
(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);
})();
Along with _gaq.push(['_trackEvent',...)
not tracking required event.
Can I do pagetracking with SDK and event tracking in normal web HTML method?
You should implement the Google Analytics native SDK and make it react using the UIWebviewDelegate or Javascript events.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With