From: Ben Soares Date: Fri, 16 Jun 2023 09:09:12 +0000 (+0100) Subject: JAL-4001 make page_location the same encoding as the old jgoogleanalytics X-Git-Tag: Release_2_11_3_0~13^2~8 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=0f72eae506d32d20f11908522330d49889818f10;p=jalview.git JAL-4001 make page_location the same encoding as the old jgoogleanalytics --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 85bde58..fc9ddda 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -978,8 +978,21 @@ public class Cache + " Desktop"; String version = Cache.getProperty("VERSION") + "_" + Cache.getDefault("BUILD_DATE", "unknown"); - String path = "/" - + String.join("/", appName, version, APPLICATION_STARTED); + String path; + /* we don't want to encode ':' as "%3A" for backward compatibility with the UA setup + try + { + path = "/" + String.join("/", URLEncoder.encode(appName, "UTF-8"), + URLEncoder.encode(version, "UTF-8"), + URLEncoder.encode(APPLICATION_STARTED, "UTF-8")); + } catch (UnsupportedEncodingException e) + { + */ + path = ("/" + String.join("/", appName, version, APPLICATION_STARTED)) + .replace(' ', '+'); + /* + } + */ GoogleAnalytics4 ga4 = GoogleAnalytics4.getInstance(); // This will add a page_view similar to the old UA analytics.