0

I'm trying to get the App Center Analytics overview to show multiple active users using a windows WPF .Net Framework application. But even if I run instances on different machines, and the code creates a new guid for each running instance of the app, it still only shows one active user.

Furthermore, when I look at the number of users on the analytics Events area, it only shows 2 users have been raising the events, even if I restart the test app on both machines.

The end goal is an app that runs on multiple kiosks in a store, where customers can log into any of them.

So, I'm looking for a couple things;

  1. Active Users shows the correct count of active users
  2. if I change the AppCenter.SetUserId in the app, like when a different user logs into the app on the same machine, which I am with this test app every time it runs, then on the events screen (and elsewhere?, I'm still learning all of this), the number of users raising the event should go up too.

Right now it seems that users, at least for the Events screen, really means the number of unique machines the app is running on, as if I run the app more than once on the same machine, it does not add to the number of users on the event screen. When I ran my app on a third machine, then the user count on the event screen went to three.

Below is the MainWindow.xaml.cs file with all the code.

using System.Collections.Generic;
using System.Windows;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
namespace WpfApp2
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            AppCenter.Start("e169e7b0-dbd3-472f-9e5e-6d8e61a8bd74", typeof(Analytics));

            AppCenter.SetUserId(Guid.NewGuid().ToString());

            Analytics.TrackEvent("Video clicked", new Dictionary<string, string> {
                { "Category", "WPF" },
                { "FileName", "favorite.avi"}
            });
            Analytics.TrackEvent("Video clicked", new Dictionary<string, string> {
                { "Category", "WPF" },
                { "FileName", "leastFav.avi"}
            });
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Analytics.TrackEvent("Screen Button clicked", 
                new Dictionary<string, string> {{ "ButtonNumber", "1" }});
        }
    }
}

enter image description here enter image description here

ToddK
  • 765
  • 9
  • 16
  • MS has documentation on their [page](https://learn.microsoft.com/en-us/appcenter/sdk/other-apis/xamarin#identify-users) that UserID `will be shown with your crash reports but not used for aggregation or counts of affected users`. – YK1 Aug 29 '23 at 03:14

0 Answers0