libSoftMeter
libSoftMeter copied to clipboard
Test, adapt SoftMeter for sending statistics to a Google Analytics 4 ("G-xxxx") property (not Universal Analytics, "UA-xxxx-y")
- Google Analytics introduced in 2020 a new type of tracking property, the "Google Analytics 4" property.
- Google Analytics 4 property IDs start with "G-".
- "Universal Analytics" properties start with a "UA-" prefix.
- SoftMeter, expects the property ID, as given by the Desktop application, to start with "UA-" and rejects the calls if the ID passed is not like that.
- In an upcoming version of SoftMeter we will add support for Google Analytics 4 properties.
- Google Analytics new properties are created by default as Google Analytics 4 properties.
What you need to do to collect usage statistics of your software application via SoftMeter:
- You must create a "Universal Analytics" property (if you do not already have one). Read here how to create a Universal Analytics, "UA-" property to use it with SoftMeter without waiting for the [SoftMeter version] (https://github.com/starmessage/libSoftMeter/blob/master/ChangeLog.md) that will support Google Analytics 4.
Universal Analytics will no longer process new data in standard properties beginning July 1, 2023. Prepare now by setting up and switching over to a Google Analytics 4 property.
Excuse me, When will it be supported?
We are working on GA4 compatibility, to get it ready in time. There is no ETA yet.
Any progress?
This is the 2.0.0 beta version, adding support for Google Analytics 4 properties (Measurement ID in the form of G-xxxxxxxx) libSoftmeter v2.0.0 beta.zip
Changes needed in your program:
- before calling the Softmeter start() function, you need to provide the ApiSecret string of your GA4 property. setOptions("ApiSecret=Your-Api-Secret-As-given-from-GA-administration-config");
- at the call of the start() function, replace your UA-xxxxxxxx-y property ID of your Universal analytics property, with the GA4 measurement id, in the form of G-zzzzzzzzzz
Missing functionality in this version:
- Google has not yet announced a date for the public release of the GA4 measurement API. Features are still missing from the API: recording of screen resolution, app name, app version, user language, country, etc. We are looking to find a workaround for these issues.
No version 2.0 demo for delphi
I hope to see the richer documents of version 2.0 as soon as possible
SoftMeter version 2.0.1 was released. https://github.com/starmessage/libSoftMeter/tree/master/bin The Delphi, C/C++ samples will soon be updated. The only change needed (apart of cource of replacing the UA-xxxxx property number with the G-xxxxxx property) is to call the setOptions() function to pass your API secret. (see comment above). As always, the setOptions() must be called before the start() function is called.
Instructions on how to setup your GA4 property to collect application usage data from SoftMeter and the creation of custom dimensions for the SoftMeter PRO metadata. https://www.starmessagesoftware.com/blog/create-configure-ga4-google-analytics-property-softmeter
I use delphi to test. When calling the start() function, if the parameter appVersion is null, version 1.0 is normal, but version 2.0 crashes
Thanks for reporting this. It is fixed and will be available in the next version. However, the parameters of the start() function should not be NULL. You must pass valid strings.
We are closing this issue as it is specific to the GA4 compatibility. Please open new issues for any bug or improvement that you want to report.