http://www.councilmapserver.com/gwt-analytics/GWT_Analytics_Test.html
It is a GWT application that makes a call to the method detailed at
the start of this thread.
It has been compiled without obfuscation so that hopefully someone can
help work out why the Google Analytics code isn't sending the tracking
beacon (making the __utm.gif GET request).
On Jan 26, 8:53 am, Dugald <dugald.mor...@gmail.com> wrote:
> Fromhttp://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI...,
> it says:
>
> Your compiled script runs in a nested frame, and $wnd and $doc are
> automatically initialized to correctly refer to the host page's window
> and document.
>
> Can someone perhaps tell me if they this this is the reason why the
> code isn't running as expected.
>
> On Jan 25, 2:42 pm, Dugald <dugald.mor...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I have a GWT application (http://www.councilmapserver.com/cms-demo/
> > 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.gifis made).
>
> > I have created a similar piece of code with straight HTML and
> > JavaScript athttp://www.councilmapserver.com/AnalyticsTest/AnalyticsTest-LateDynam...
> > 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