X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=57419085599b17f02204b00561d9f9e93047bad9;hb=a7169b1c72607f3c9357195b4999869650a2a891;hp=4e73b823e239477396063e685e433874e5adafc6;hpb=a971d440b2079bd1c351a563d9a17e866710ae5a;p=jalview.git
diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java
index 4e73b82..5741908 100755
--- a/src/jalview/bin/Cache.java
+++ b/src/jalview/bin/Cache.java
@@ -53,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;
@@ -129,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
@@ -955,16 +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()
{
- initGoogleTracker(false);
- }
-
- public static void initGoogleTracker(boolean headless)
- {
- GoogleAnalytics4.setEnabled(true);
+ Plausible.setEnabled(true);
String appName = ChannelProperties.getProperty("app_name") + " Desktop";
String version = Cache.getProperty("VERSION") + "_"
@@ -983,39 +978,18 @@ public class Cache
pathParts.add(appName);
pathParts.add(version);
pathParts.add(APPLICATION_STARTED);
- if (headless)
- {
- pathParts.add("headless");
- }
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.
- String[] params;
- if (headless)
- {
- params = new String[] { "page_location",
- GoogleAnalytics4.APPLICATION_BASE_URL + path, "page_title",
- APPLICATION_STARTED, "headless", "true" };
- }
- else
- {
- params = new String[] { "page_location", path, "page_title",
- APPLICATION_STARTED };
- }
- ga4.sendAnalytics("page_view", params);
+ 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, params);
+ 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