Merge branch 'task/JAL-4001_Plausible_API' into improvement/JAL-3830_remove_dock_icon...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 28 Jun 2023 13:57:56 +0000 (14:57 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 28 Jun 2023 13:57:56 +0000 (14:57 +0100)
1  2 
src/jalview/bin/Jalview.java

@@@ -633,8 -633,7 +633,7 @@@ public class Jalvie
      {
        headless = true;
      }
-     System.setProperty("http.agent",
-             "Jalview Desktop/" + Cache.getDefault("VERSION", "Unknown"));
+     System.setProperty("http.agent", HttpUtils.getUserAgent());
  
      try
      {
          }
          else
          {
 +          // record usage stats if in headless mode
 +          if (Cache.getDefault("USAGESTATS", false))
 +          {
 +            Cache.initGoogleTracker(headlessArg);
 +          }
            Jalview.exit("Successfully completed commands in headless mode",
                    0);
          }
                      + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
                      + "-noquestionnaire\tTurn off questionnaire check.\n"
                      + "-nonews\tTurn off check for Jalview news.\n"
-                     + "-nousagestats\tTurn off google analytics tracking for this session.\n"
+                     + "-nousagestats\tTurn off analytics tracking for this session.\n"
                      + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
                      // +
                      // "-setprop PROPERTY=VALUE\tSet the given Jalview property,
       */
      PromptUserConfig prompter = new PromptUserConfig(Desktop.desktop,
              "USAGESTATS",
-             MessageManager.getString("prompt.google_analytics_title"),
-             MessageManager.getString("prompt.google_analytics"),
+             MessageManager.getString("prompt.plausible_analytics_title"),
+             MessageManager.getString("prompt.plausible_analytics"),
              new Runnable()
              {
                @Override
                public void run()
                {
-                 Console.debug(
-                         "Initialising googletracker for usage stats.");
-                 Cache.initGoogleTracker();
+                 Console.debug("Initialising analytics for usage stats.");
+                 Cache.initAnalytics();
                  Console.debug("Tracking enabled.");
                }
              }, new Runnable()
                @Override
                public void run()
                {
-                 Console.debug("Not enabling Google Tracking.");
+                 Console.debug("Not enabling analytics.");
                }
              }, null, true);
      desktop.addDialogThread(prompter);