Google Analytics tracking backport
[jalview.git] / src / jalview / bin / Jalview.java
index 36f4ff6..0179023 100755 (executable)
@@ -83,6 +83,7 @@ public class Jalview
                       + "-eps FILE\tCreate EPS file FILE from alignment."
                       + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires."
                       + "-noquestionnaire\tTurn off questionnaire check."
+                      + "-nousagestats\tTurn off google analytics tracking for this session.\n"
                       + "-dasserver nickname=URL\tAdd and enable a das server with given nickname (alphanumeric or underscores only) for retrieval of features for all alignments."
                       + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them."
                       + "-groovy FILE\tExecute groovy script in FILE, after all other arguments have been processed (if FILE is the text 'STDIN' then the file will be read from STDIN)"
@@ -135,6 +136,13 @@ public class Jalview
       desktop = new Desktop();
       desktop.setVisible(true);
       desktop.discoverer.start();
+      if (!aparser.contains("nousagestats") && Cache.getDefault("USAGESTATS", true)) {
+        Cache.log.info("Initialising googletracker for usage stats.");
+        Cache.initGoogleTracker();
+        Cache.log.debug("Tracking enabled.");
+      } else {
+        Cache.log.info("Not enabling Google Tracking.");
+      }
       if (!aparser.contains("noquestionnaire"))
       {
         String url = aparser.getValue("questionnaire");