public void TrackEvent( EventData eventData, List <CustomDimension> customDimensions, List <CustomMetric> customMetrics ) { var builder = new HitBuilders.EventBuilder() .SetCategory(eventData.EventCategory) .SetAction(eventData.EventAction); if (!string.IsNullOrWhiteSpace(eventData?.EventLabel)) { builder.SetLabel(eventData.EventLabel); } if (!string.IsNullOrWhiteSpace(eventData?.EventLabel)) { builder.SetValue(eventData.Id); } if (customDimensions?.Count > 0) { foreach (var customDimension in customDimensions) { builder.SetCustomDimension(customDimension.DimensionIndex, customDimension.DimensionValue); } } if (customMetrics?.Count > 0) { foreach (var customMetric in customMetrics) { builder.SetCustomMetric(customMetric.MetricIndex, customMetric.MetricValue); } } analyticsTracker.Send(builder.Build()); }