I've got Google Analytics working now. Solution is to put a hidden iframe in the AIR app which serves a page from my web server. That page has the Google Analytics code on it and calls trackPageView with whatever is on the querystring:
PHP Code:
<script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script>
<script type="text/javascript">
window.onload = function() {
var pageTracker = _gat._getTracker("SITE CODE");
var s = document.location.search;
if (s.length > 1) {
s = s.substring(1);
pageTracker._trackPageview(s);
}
}
</script>
Then in my AIR app I have a function that can log any action by reloading the iframe:
PHP Code:
function track(action){
document.getElementById('googleFrame').src = 'http://my.domain/ga.html?' + action;
}