public static void TrackCustomMatomo(string category, string action, string name = "", string value = "", Dictionary <string, string> properties = null) { if (!LocalContext.GetTelemetrySettings()) { return; } try { if (piwikTracker == null) { Initialize(); } piwikTracker.SetUserAgent(TelemetryUtilities.UserAgent); if (properties != null) { foreach (var prop in properties) { piwikTracker.SetCustomTrackingParameter(prop.Key, prop.Value); } } piwikTracker.DoTrackEvent(category, action, name, value); } catch { } }
public static void TrackCustomAppInsights(string trackName, Dictionary <string, double> metrics, Dictionary <string, string> properties) { if (!LocalContext.GetTelemetrySettings()) { return; } try { var telemetryClient = TelemetryClient; EventTelemetry telemetry = new EventTelemetry(); telemetry.Name = trackName; foreach (var prop in properties) { telemetry.Properties.Add(prop); } foreach (var metric in metrics) { telemetry.Metrics.Add(metric); } telemetryClient.TrackEvent(telemetry); } catch { } }
public static void TrackCustomAmplitude(string trackName, string user_id, Dictionary <string, string> user_properties) { if (!LocalContext.GetTelemetrySettings()) { return; } TrackAmplitudeAsync(requestUri, api_key, user_id, user_properties, event_type: trackName); }
public static void TrackCustom(string trackName, Dictionary <string, double> metrics, Dictionary <string, string> properties) { if (!LocalContext.GetTelemetrySettings()) { return; } AppInsightsTelemetry.TrackCustomAppInsights(trackName, metrics, properties); MatomoTelemetry.TrackCustomMatomo(trackName, "", "", "", properties); AmplitudeTelemetry.TrackCustomAmplitude(trackName, TelemetryUtilities.UserAgent, properties); }
public static void Track(this SpeckleApiClient speckleApiClient, string trackName) { if (!LocalContext.GetTelemetrySettings()) { return; } speckleApiClient.TrackWithMetaMatomo(trackName, ""); speckleApiClient.TrackWithMetaAppInsights(trackName); speckleApiClient.TrackWithMetaAmplitude(trackName); }
public static void RecordTestEvent(string clientType) { Initialize(); if (LocalContext.GetTelemetrySettings() == false) { return; } var segmentation = GetSegmentation(clientType); var test = Countly.RecordEvent("test-event", 1, segmentation).Result; }
public static void TrackWithMetaAmplitude(this SpeckleApiClient speckleApiClient, string trackName) { if (!LocalContext.GetTelemetrySettings()) { return; } try { var properties = speckleApiClient.GetTrackClientProperties(); properties.Add("object_num", speckleApiClient.GetNumberOfObjects().ToString()); var user_email = TelemetryUtilities.ComputeSHA256Hash(speckleApiClient.User.Email); TrackAmplitudeAsync(requestUri, api_key, user_email, properties, trackName); } catch { } }
public static void RecordStreamUpdated(string clientType) { Initialize(); if (LocalContext.GetTelemetrySettings() == false) { return; } Task.Run(() => { try { Countly.RecordEvent("stream-updated", 1, GetSegmentation(clientType)); } catch { } }); }
public static void Initialize( ) { if (isInitialized) { return; } if (LocalContext.GetTelemetrySettings() == false) { return; } try { DeviceId = new DeviceIdBuilder() .AddMachineName() .AddProcessorId() .UseFormatter(new HashDeviceIdFormatter(() => SHA256.Create(), new Base64UrlByteArrayEncoder())) .ToString(); var config = new CountlyConfig() { serverUrl = "https://telemetry.speckle.works", appKey = "cd6db5058036aafb6a3a82681d434ad74ee50ad9", deviceIdMethod = Countly.DeviceIdMethod.developerSupplied, developerProvidedDeviceId = DeviceId }; Countly.IsLoggingEnabled = true; Countly.Instance.Init(config); Countly.Instance.RecordView("speckle-init"); Countly.Instance.RecordView("speckle-init/version/" + typeof(SpeckleTelemetry).Assembly.GetName().Version); isInitialized = true; }catch (Exception e) { // POKEMON isInitialized = false; } }