I have all the Google Analytics code between the and in my HTML file. These stats are processed correctly.
After a onclick event on my , function below is called and I would like to send an event to Google Analytics, but it is never received. What am I doing wrong?
public static native void googleAnalyticsEvent(String boxId) /*-{
_gaq.push(['_trackEvent', boxId , 'Click']);
}-*/;
FYI, if I replace this code for the below, an alert is correctly displayed:
public static native void googleAnalyticsEvent(String boxId) /*-{
alert(boxId);
}-*/;
Try:
From https://developers.google.com/web-toolkit/doc/1.6/DevGuideCodingBasics#DevGuideJavaScriptNativeInterface