This article will describe how the application version is deduced automatically by the monitor (if possible), and how you can override that mechanism and provide an explicit version number if needed.
You application will report its version number as part of the session data. The version number is a dot-separated string "major.minor" with optional build and revision numbers - for example "3.4.3".
The version number is a vital aspect of your application. For instance, the global filters can filter everything based on versions. It is also represented in the Version report, as in this example:
Getting the version right is therefore quite important.
On some platforms the monitor can deduce this automatically. On others it has to be provided explicitly by hand. However, on all platforms it can be specified explicitly if you want to.
The table below show on what platforms the monitor can deduce the application version by itself, and how it is done:
|Android||Manual, but use this coding practice:
|iOS||Manual, but use this coding practice:
|Manual only, no recommended best practice|
|AppBuilder||Taken from project > Properties > Version|
|Full .NET||Taken from
|WinRT||Manual, but use this coding practice:
For those platforms where the application version cannot be deduced automatically, or where the automation does not produce the version number you desire, you can specify the
version explicitly when creating the monitor or the monitor settings:
// C# for .NET, Silverlight etc IAnalyticsMonitorSettings settings = AnalyticsMonitorFactory.CreateSettings("key"); settings.Version = new Version(1,2,3,4);
' VB.NET Dim settings As IAnalyticsMonitorSettings = AnalyticsMonitorFactory.CreateSettings("key") settings.Version = new Version(1,2,3,4)
// C++ for Windows IAnalyticsMonitorSettings *settings = AnalyticsMonitorFactory::CreateSettings("key", "18.104.22.168");
// C for Windows Eqatec_IAnalyticsMonitorSettings *settings = Eqatec_AnalyticsMonitorFactory_CreateSettings("key", "22.214.171.124");
// Objective-C for iOS and MacOSX EQATECAnalyticsMonitorSettings *settings = [EQATECAnalyticsMonitorSettings settingsWithProductId:@"key" version:@"126.96.36.199"];
// Java for Android and Java IAnalyticsMonitorSettings settings = AnalyticsMonitorFactory.createSettings("key", new Version("188.8.131.52"));
If you pass along a version string that is not in the expected numeric format
"major.minor.build.revision") then the Create methods will fail in a platform-dependent manner. On .NET it will throw an exception, for instance.
Passing an invalid version string or product key is the only thing that will cause the API to fail. Please see the section on the monitor's General Behavior for more information.
On some platforms your application version can be deduced automatically. On others you will have to specify it manually. This article has given you an overview of the behavior on all platforms.