CMS.html) in which I dynamically configure the analytics code. The
code is as follows:
private native void initialiseAnalytics(final String analyticsAccount,
final String domainName) /*-{
try {
$wnd._gaq = $wnd._gaq || [];
$wnd._gaq.push(['_setAccount', analyticsAccount]);
$wnd._gaq.push(['_setDomainName', domainName]);
$wnd._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);
})();
} catch (e) {
$wnd.alert("JSNI method GoogleAnalytics.initialiseAnalytics()
threw an exception:" + e);
}
}-*/;
The code executes without reporting any errors, however, the tracking
beacon is never sent (no GET request for __utm.gif is made).
I have created a similar piece of code with straight HTML and
JavaScript at http://www.councilmapserver.com/AnalyticsTest/AnalyticsTest-LateDynamicLoading.html
which does result in the tracking beacon being sent. Can anyone shed
some light into what the differences may be?
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment