JAL-4001 change Plausible discovery URL
[jalview.git] / src / jalview / analytics / Plausible.java
index daf2d9a..b703c69 100644 (file)
@@ -22,7 +22,6 @@ import java.util.Map;
 
 import jalview.bin.Cache;
 import jalview.bin.Console;
-import jalview.bin.Jalview;
 import jalview.util.ChannelProperties;
 import jalview.util.HttpUtils;
 
@@ -35,9 +34,9 @@ public class Plausible
 
   private static final String DOMAIN = "jalview.org";
 
-  private static final String CONFIG_API_BASE_URL = "https://www.jalview.org/config/analytics/url";
+  private static final String CONFIG_API_BASE_URL = "https://www.jalview.org/services/analytics/config/url";
 
-  private static final String DEFAULT_API_BASE_URL = "https://DEFAULT.plausible.io/api/event";
+  private static final String DEFAULT_API_BASE_URL = "https://plausible.io/api/event";
 
   private static final String API_BASE_URL;
 
@@ -85,6 +84,15 @@ public class Plausible
             System.getProperty("os.arch") + " "
                     + System.getProperty("os.name") + " "
                     + System.getProperty("os.version"));
+    defaultProps.put("os", System.getProperty("os.name"));
+    defaultProps.put("os_version", System.getProperty("os.version"));
+    defaultProps.put("os_arch", System.getProperty("os.arch"));
+    String installation = Cache.applicationProperties
+            .getProperty("INSTALLATION");
+    if (installation != null)
+    {
+      defaultProps.put("installation", installation);
+    }
 
     // ascertain the API_BASE_URL
     API_BASE_URL = getAPIBaseURL();
@@ -137,10 +145,6 @@ public class Plausible
     if (sendDefaultProps)
     {
       props.putAll(defaultProps);
-      if (Jalview.isHeadlessMode())
-      {
-        props.put("headless", "true");
-      }
     }
 
     // add (and overwrite with) the passed in props
@@ -566,4 +570,4 @@ public class Plausible
     }
     return DEFAULT_API_BASE_URL;
   }
-}
\ No newline at end of file
+}