private static GoogleAnalytics4 instance = null;
- private static final String appName;
-
- private static final String version;
+ private static final Map<String, String> defaultParams;
static
{
- appName = ChannelProperties.getProperty("app_name") + " Desktop";
- version = Cache.getProperty("VERSION") + "_"
- + Cache.getDefault("BUILD_DATE", "unknown");
+ defaultParams = new HashMap<>();
+ defaultParams.put("app_name",
+ ChannelProperties.getProperty("app_name") + " Desktop");
+ defaultParams.put("version", Cache.getProperty("VERSION"));
+ defaultParams.put("build_date",
+ Cache.getDefault("BUILD_DATE", "unknown"));
+ defaultParams.put("java_version", System.getProperty("java.version"));
+ String val = System.getProperty("sys.install4jVersion");
+ if (val != null)
+ {
+ defaultParams.put("install4j_version", val);
+ }
+ val = System.getProperty("installer_template_version");
+ if (val != null)
+ {
+ defaultParams.put("install4j_template_version", val);
+ }
+ val = System.getProperty("launcher_version");
+ if (val != null)
+ {
+ defaultParams.put("launcher_version", val);
+ }
+ defaultParams.put("java_arch",
+ System.getProperty("os.arch") + " "
+ + System.getProperty("os.name") + " "
+ + System.getProperty("os.version"));
}
private GoogleAnalytics4()
Map<String, String> params = new HashMap<>();
// add these to all events from this application instance
- params.put("app_name", appName);
- params.put("version", version);
+ params.putAll(defaultParams);
- // can be overwritten by passed in params
+ // add (and overwrite with) the passed in params
if (paramsStrings != null && paramsStrings.length > 0)
{
if (paramsStrings.length % 2 != 0)