Skip to content
This repository has been archived by the owner on Nov 12, 2020. It is now read-only.

Commit

Permalink
disable analytics for EAP builds
Browse files Browse the repository at this point in the history
  • Loading branch information
heiko-braun committed Dec 19, 2012
1 parent 03d5265 commit ba3d373
Showing 1 changed file with 12 additions and 3 deletions.
Expand Up @@ -3,6 +3,7 @@
import com.google.gwt.core.client.GWT;
import com.google.inject.Provider;
import com.gwtplatform.mvp.client.googleanalytics.GoogleAnalytics;
import org.jboss.as.console.client.Build;
import org.jboss.as.console.client.shared.Preferences;

/**
Expand All @@ -19,9 +20,17 @@ public GoogleAnalytics get() {

GoogleAnalytics analytics = null;

if(!Preferences.has(Preferences.Key.ANALYTICS) // not set at all
|| Preferences.get(Preferences.Key.ANALYTICS).equals("true")
&& GWT.isScript() ) // web mode only
// no preferences == enabled
boolean prefEnabled = !Preferences.has(Preferences.Key.ANALYTICS)
|| Preferences.get(Preferences.Key.ANALYTICS).equals("true");

// disabled for EAP by default
boolean isEAP = Build.PROFILE.equalsIgnoreCase("eap");

// web mode only
boolean isWebMode = GWT.isScript();

if(!isEAP && prefEnabled && isWebMode)
{
analytics = new CustomAnalyticsImpl();
System.out.println("Google analytics is setup");
Expand Down

0 comments on commit ba3d373

Please sign in to comment.