Skip to content

Commit

Permalink
Update: Additional metadata for the currently used device
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoffer committed Mar 15, 2023
1 parent 367a5df commit 0de0737
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Matomo.Xamarin.Forms/MatomoAnalytics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public string UserAgent
{
if (string.IsNullOrEmpty(_userAgent))
{
_userAgent = $"Mozilla/5.0 ({DeviceInfo.Platform} {DeviceInfo.VersionString}; {DeviceInfo.Manufacturer} {DeviceInfo.Model})";
_userAgent = $"Mozilla/5.0 ({DeviceInfo.Model}; {DeviceInfo.Platform} {DeviceInfo.VersionString}) {AppInfo.Name}/{AppInfo.VersionString}";
}
return _userAgent;
}
Expand Down Expand Up @@ -248,6 +248,7 @@ NameValueCollection CreateParameters()
parameters["cdt"] = (DateTimeOffset.UtcNow.ToUnixTimeSeconds()).ToString(); // TODO dispatching cdt older thant 24 h needs token_auth in bulk request
parameters["lang"] = CultureInfo.CurrentCulture.TwoLetterISOLanguageName;
parameters["ua"] = UserAgent;
parameters["res"] = $"{DeviceDisplay.MainDisplayInfo.Width}x{DeviceDisplay.MainDisplayInfo.Height}";

foreach (var dimension in Dimensions)
parameters[$"dimension{dimension.Id}"] = dimension.Value;
Expand Down

0 comments on commit 0de0737

Please sign in to comment.