X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=57419085599b17f02204b00561d9f9e93047bad9;hb=d17a8d70dedafa76dd0bb6c7c8a280a516464dac;hp=8015cd52141c1938da15116a6092d71a010f2a6a;hpb=77e37b9460441033c19756d8e75b681c087cb615;p=jalview.git
diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java
index 8015cd5..5741908 100755
--- a/src/jalview/bin/Cache.java
+++ b/src/jalview/bin/Cache.java
@@ -43,6 +43,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
@@ -52,7 +53,7 @@ import java.util.TreeSet;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
-import jalview.analytics.GoogleAnalytics4;
+import jalview.analytics.Plausible;
import jalview.datamodel.PDBEntry;
import jalview.gui.Preferences;
import jalview.gui.UserDefinedColours;
@@ -128,7 +129,7 @@ import jalview.ws.sifts.SiftsSettings;
* service
*
QUESTIONNAIRE last questionnaire:responder id string from questionnaire
* service
- * USAGESTATS (false - user prompted) Enable google analytics tracker for
+ * USAGESTATS (false - user prompted) Enable analytics tracker for
* collecting usage statistics
* SHOW_OVERVIEW boolean for overview window display
* ANTI_ALIAS boolean for smooth fonts
@@ -954,11 +955,11 @@ public class Cache
}
/**
- * Initialise the google tracker if it is not done already.
+ * Initialise the tracker if it is not done already.
*/
- public static void initGoogleTracker()
+ public static void initAnalytics()
{
- GoogleAnalytics4.setEnabled(true);
+ Plausible.setEnabled(true);
String appName = ChannelProperties.getProperty("app_name") + " Desktop";
String version = Cache.getProperty("VERSION") + "_"
@@ -973,25 +974,22 @@ public class Cache
} catch (UnsupportedEncodingException e)
{
*/
- path = ("/" + String.join("/", appName, version, APPLICATION_STARTED))
- .replace(' ', '+');
+ List pathParts = new ArrayList<>();
+ pathParts.add(appName);
+ pathParts.add(version);
+ pathParts.add(APPLICATION_STARTED);
+ path = ("/" + String.join("/", pathParts)).replace(' ', '+');
/*
}
*/
- GoogleAnalytics4 ga4 = GoogleAnalytics4.getInstance();
-
- // This will add a page_view similar to the old UA analytics.
- // We probably want to get rid of this once the application_launch event
- // is being processed properly.
- ga4.sendAnalytics("page_view", "page_location", path, "page_title",
- APPLICATION_STARTED);
+ Plausible plausible = Plausible.getInstance();
// This will send a new "application_launch" event with parameters
// including the old-style "path", the channel name and version
- ga4.sendAnalytics("application_launch", true, "page_location", path);
+ plausible.sendEvent("application_launch", path, true);
}
- private static final String APPLICATION_STARTED = "Application Started.";
+ private static final String APPLICATION_STARTED = "Application Started";
/**
* get the user's default colour if available