Google analytics doesn’t work with jquery mobile websites. Luckily, I found the way to make this work.

Basically you have to break the code into 2 parts:

 
 
<script>
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-xxxxxx-xx']);
 
    (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);
    })();
 
$('[data-role=page]').live('pageshow', function (event, ui) {
    try {
 
        hash = location.hash;
 
        if (hash && hash.length > 1) {
            _gaq.push(['_trackPageview', hash.substr(1)]);
        } else {
            _gaq.push(['_trackPageview']);
        }
    } catch(err) {
 
    }
 
});
</script>

Just copy your id from the usual anayltics code and input it in: UA-xxxxxx-xx

More info here and here