This question is locked. New answers and comments are not allowed.
We are using Icenium for our mobile project. We have an index.html file in Icenium that sets up our app to use Kendo (via a call to "new kendo.mobile.Application()" ). We then have our app pulling remote views from an MVC 4 solution via Ajax. All of this works perfectly. We are using the Device Simulator to test.
We came upon this issue when trying to integrate Google Analytics (GA). I got our GA code to work on another website, then copied the code to this project. In the index.html file in Icenium, I pasted this code in the <head> of the page (account # scrubbed):
Then, in each remote view that is pulled via Ajax, we have this piece of code included:
The problem is that even with this piece of code included, the "utm.gif" request is never sent to GA. First, I set "debugger;" right after the push() call to make sure the code was hitting it, and it was. Then, I found that Google provides a debugging JS file for GA, so I used that file instead to see what was going on (just replace "/ga.js" with "/u/ga_debug.js" in the <head>).
At that point, I refreshed the Device Simulator, and this is what shows in the console:
When I use the same debugging JS file from GA on my other website, there is another console entry after the "Track Pageview," which says, "Tracking beacon sent". As you can see, the tracking beacon is not sent in our Icenium project. It gets to the point of outputting "Track Pageview" but we just cannot get it to send the actual request to GA.
Is there something obvious we are missing? Is there some "gotcha" with Icenium that is keeping the request from being sent to GA? Any help is greatly appreciated!
We came upon this issue when trying to integrate Google Analytics (GA). I got our GA code to work on another website, then copied the code to this project. In the index.html file in Icenium, I pasted this code in the <head> of the page (account # scrubbed):
<
script
>
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-XXXXX-4']
);
(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
>
Then, in each remote view that is pulled via Ajax, we have this piece of code included:
<
script
>
$(function () {
if (typeof (_gaq) !== "undefined") {
_gaq.push(['_trackPageview', '/Home/Index']);
}
});
</
script
>
The problem is that even with this piece of code included, the "utm.gif" request is never sent to GA. First, I set "debugger;" right after the push() call to make sure the code was hitting it, and it was. Then, I found that Google provides a debugging JS file for GA, so I used that file instead to see what was going on (just replace "/ga.js" with "/u/ga_debug.js" in the <head>).
At that point, I refreshed the Device Simulator, and this is what shows in the console:
_gaq.push processing "_setAccount" for args: "[UA-XXXXX-4]": console-via-logger.js:182
_gaq.push processing "_trackPageview" for args: "[/Home/Index]": console-via-logger.js:182
Track Pageview
When I use the same debugging JS file from GA on my other website, there is another console entry after the "Track Pageview," which says, "Tracking beacon sent". As you can see, the tracking beacon is not sent in our Icenium project. It gets to the point of outputting "Track Pageview" but we just cannot get it to send the actual request to GA.
Is there something obvious we are missing? Is there some "gotcha" with Icenium that is keeping the request from being sent to GA? Any help is greatly appreciated!