Пример #1
0
        public virtual async Task TrackPageViewAsync(string viewName, Dictionary <string, string> properties)
        {
            tracker.SetScreenName(viewName);

            var viewToTrack = new HitBuilders.ScreenViewBuilder().Build();

            if (properties != null)
            {
                foreach (var property in properties)
                {
                    viewToTrack.Add(property.Key, property.Value);
                }
            }

            tracker.Send(viewToTrack);
        }
        public virtual async Task TrackPageViewAsync(string viewName, Dictionary <string, string> properties)
        {
            try
            {
                Tracker.SetScreenName(viewName);

                var viewToTrack = new HitBuilders.ScreenViewBuilder().Build();

                if (properties != null)
                {
                    foreach (var property in properties)
                    {
                        viewToTrack.Add(property.Key, property.Value);
                    }
                }

                Tracker.Send(viewToTrack);
            }
            catch (Exception ex)
            {
                _ = TinyInsights.TrackErrorAsync(ex);
            }
        }