public async Task TrackDependencyAsync(string dependencyType, string dependencyName, DateTimeOffset startTime, TimeSpan duration, bool success, int resultCode = 0, Exception exception = null) { try { if (IsTrackDependencyEnabled) { var properties = new Dictionary <string, string>(); properties.Add("DependencyType", dependencyType); properties.Add("DependencyName", dependencyName); properties.Add("Duration", duration.ToString()); properties.Add("StartTime", startTime.ToString()); properties.Add("Success", success.ToString()); properties.Add("ResultCode", resultCode.ToString()); if (exception != null) { properties.Add("Exception message", exception.Message); properties.Add("StackTrace", exception.StackTrace); if (exception.InnerException != null) { properties.Add("Inner exception message", exception.InnerException.Message); properties.Add("Inner exception stackTrace", exception.InnerException.StackTrace); } } Analytics.TrackEvent("Dependency", properties); } } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public async Task TrackDependencyAsync(string dependencyType, string dependencyName, DateTimeOffset startTime, TimeSpan duration, bool success, int resultCode = 0, Exception exception = null) { try { var dependency = new DependencyTelemetry(dependencyType, dependencyName, startTime, duration, success) { ResultCode = resultCode.ToString() }; if (exception != null) { var properties = new Dictionary <string, string>(); properties.Add("Exception message", exception.Message); properties.Add("StackTrace", exception.StackTrace); if (exception.InnerException != null) { properties.Add("Inner exception message", exception.InnerException.Message); properties.Add("Inner exception stackTrace", exception.InnerException.StackTrace); } } client.TrackDependency(dependency); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public virtual async Task TrackDependencyAsync(string dependencyType, string dependencyName, DateTimeOffset startTime, TimeSpan duration, bool success, int resultCode = 0, Exception exception = null) { try { var dependencyToTrack = DictionaryBuilder.CreateTiming(dependencyType, duration.Milliseconds, dependencyName, success.ToString()).Build(); dependencyToTrack.Add((NSString)"ResultCode", (NSString)resultCode.ToString()); if (exception != null) { dependencyToTrack.Add(NSObject.FromObject("Exception message"), NSObject.FromObject(exception.Message)); dependencyToTrack.Add(NSObject.FromObject("StackTrace"), NSObject.FromObject(exception.StackTrace)); if (exception.InnerException != null) { dependencyToTrack.Add(NSObject.FromObject("Inner exception message"), NSObject.FromObject(exception.InnerException.Message)); dependencyToTrack.Add(NSObject.FromObject("Inner exception stackTrace"), NSObject.FromObject(exception.InnerException.StackTrace)); } } Tracker.Send(dependencyToTrack); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public async Task TrackDependencyAsync(string dependencyType, string dependencyName, DateTimeOffset startTime, TimeSpan duration, bool success, int resultCode = 0, Exception exception = null) { try { var builder = HitBuilder.CreateTiming(dependencyType, dependencyName, duration, success.ToString()); // builder.set var dependencyToTrack = builder.Build(); dependencyToTrack.Add("ResultCode", resultCode.ToString()); if (exception != null) { dependencyToTrack.Add("Exception message", exception.Message); dependencyToTrack.Add("StackTrace", exception.StackTrace); if (exception.InnerException != null) { dependencyToTrack.Add("Inner exception message", exception.InnerException.Message); dependencyToTrack.Add("Inner exception stackTrace", exception.InnerException.StackTrace); } } Tracker.Send(dependencyToTrack); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public async Task TrackDependencyAsync(string dependencyType, string dependencyName, DateTimeOffset startTime, TimeSpan duration, bool success, int resultCode = 0, Exception exception = null) { try { var builder = new HitBuilders.TimingBuilder(); builder.SetCategory(dependencyType); builder.SetVariable(dependencyName); builder.SetValue(duration.Milliseconds); builder.SetLabel(success.ToString()); var dependencyToTrack = builder.Build(); dependencyToTrack.Add("ResultCode", resultCode.ToString()); if (exception != null) { dependencyToTrack.Add("Exception message", exception.Message); dependencyToTrack.Add("StackTrace", exception.StackTrace); if (exception.InnerException != null) { dependencyToTrack.Add("Inner exception message", exception.InnerException.Message); dependencyToTrack.Add("Inner exception stackTrace", exception.InnerException.StackTrace); } } Tracker.Send(dependencyToTrack); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public async Task TrackPageViewAsync(string viewName, Dictionary <string, string> properties = null) { try { client.TrackPageView(viewName); client.Flush(); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public async Task TrackEventAsync(string eventName, Dictionary <string, string> properties = null) { try { client.TrackEvent(eventName, properties); client.Flush(); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public virtual async Task TrackEventAsync(string eventName, Dictionary <string, string> properties) { try { if (IsTrackEventsEnabled) { Analytics.TrackEvent(eventName, properties); } } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public virtual async Task TrackEventAsync(string eventName, Dictionary <string, string> properties) { try { string action = string.Empty; string label = string.Empty; int number = 0; if (properties != null && properties.ContainsKey("action")) { action = properties["action"]; } if (properties != null && properties.ContainsKey("label")) { label = properties["label"]; } if (properties != null && properties.ContainsKey("number")) { int.TryParse(properties["number"], out number); } var builder = new HitBuilders.EventBuilder(); builder.SetCategory(eventName.ToLower()); builder.SetAction(action.ToLower()); builder.SetLabel(label.ToLower()); builder.SetValue(number); var eventToTrack = builder.Build(); if (properties != null) { foreach (var property in properties) { if (property.Key != "action" && property.Key != "label" && property.Key != "number") { eventToTrack.Add(property.Key, property.Value); } } } Tracker.Send(eventToTrack); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public virtual async Task TrackEventAsync(string eventName, Dictionary <string, string> properties) { try { string action = string.Empty; string label = string.Empty; int number = 0; if (properties != null && properties.ContainsKey("action")) { action = properties["action"]; } if (properties != null && properties.ContainsKey("number")) { int.TryParse(properties["number"], out number); } if (properties != null && properties.ContainsKey("label")) { label = properties["label"]; } var eventToTrack = DictionaryBuilder.CreateEvent(eventName.ToLower(), action.ToLower(), label.ToLower(), number).Build(); if (properties != null) { foreach (var property in properties) { if (property.Key != "action" && property.Key != "label" && property.Key != "number") { eventToTrack.Add(NSObject.FromObject(property.Key), NSObject.FromObject(property.Value)); } } } Tracker.Send(eventToTrack); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public virtual async Task TrackPageViewAsync(string viewName, Dictionary <string, string> properties) { try { if (IsTrackPageViewsEnabled) { if (properties == null) { properties = new Dictionary <string, string>(); } properties.Add("PageName", viewName); Analytics.TrackEvent("PageView", properties); } } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public virtual async Task TrackPageViewAsync(string viewName, Dictionary <string, string> properties) { try { Tracker.Set(GaiConstants.ScreenName, viewName); var viewToTrack = DictionaryBuilder.CreateScreenView().Build(); if (properties != null) { foreach (var property in properties) { viewToTrack.Add(NSObject.FromObject(property.Key), NSObject.FromObject(property.Value)); } } Tracker.Send(viewToTrack); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }
public virtual async Task TrackPageViewAsync(string viewName, Dictionary <string, string> properties) { try { Tracker.ScreenName = viewName; var viewToTrack = HitBuilder.CreateScreenView().Build(); if (properties != null) { foreach (var property in properties) { viewToTrack.Add(property.Key, property.Value); } } Tracker.Send(viewToTrack); } catch (Exception ex) { _ = TinyInsights.TrackErrorAsync(ex); } }