public override void TrackEvent(string category, string action, string label = null)
        {
            var context = Application.Context;

            if (context == null)
            {
                return;
            }
            var eventBuilder = new HitBuilders.EventBuilder();

            eventBuilder.SetCategory(category)
            .SetAction(action);

            if (label != null)
            {
                eventBuilder.SetLabel(label);
            }

            foreach (var key in CustomDimensions.Keys)
            {
                eventBuilder.SetCustomDimension(key, CustomDimensions[key]);
            }

            Tracker.Send(eventBuilder.Build());
        }
        public void LogEvent(string @event)
        {
            var eventBuilder = new HitBuilders.EventBuilder("Interaction", "Event");

            eventBuilder.SetLabel(@event);

            Trackers.ForEach(x => x.Send(eventBuilder.Build()));
        }
Beispiel #3
0
 public void Track_App_Event(String GAEventCategory, String EventToTrack)
 {
     HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder();
     builder.SetCategory(GAEventCategory);
     builder.SetAction(EventToTrack);
     builder.SetLabel("AppEvent");
     GATracker.Send(builder.Build());
 }
Beispiel #4
0
        public void RastrearEvento(string categoria, string evento)
        {
            HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder();
            builder.SetCategory(categoria);
            builder.SetAction(evento);
            builder.SetLabel("AppEvent");

            GATracker.Send(builder.Build());
        }
        public void TrackAppEvent(GAEventCategory category, string eventToTrack)
        {
            HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder();
            builder.SetCategory(category.ToString());
            builder.SetAction(eventToTrack);
            builder.SetLabel("AppEvent");

            GATracker.Send(builder.Build());
        }
        public void TrackEvent(string category, string eventName, string label)
        {
            var builder = new HitBuilders.EventBuilder();
            builder.SetCategory(category);
            builder.SetAction(eventName);
            builder.SetLabel("label");

            _tracker.Send(builder.Build());
        }
 public void TrackUserId(string userid)
 {
     if (!string.IsNullOrWhiteSpace(userid))
     {
         analyticsTracker.Set("&uid", userid);
         var builder = new HitBuilders.EventBuilder();
         analyticsTracker.Send(builder.Build());
     }
 }
Beispiel #8
0
        public static void TrackAppEvent(String eventCategory, String eventToTrack)
        {
            var builder = new HitBuilders.EventBuilder();
            builder.SetCategory(eventCategory);
            builder.SetAction(eventToTrack);
            builder.SetLabel("AppEvent");

            Rep.Instance.GaTracker.Send(builder.Build());
        }
        public void Track_App_Event(String GAEventCategory, String EventToTrack)
        {
            HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder();
            builder.SetCategory(GAEventCategory);
            builder.SetAction(EventToTrack);
            builder.SetLabel("AppEvent");

            GATracker.Send(builder.Build());
        }
        public void TrackEvent(string category, string eventName, string label)
        {
            var builder = new HitBuilders.EventBuilder();

            builder.SetCategory(category);
            builder.SetAction(eventName);
            builder.SetLabel("label");

            _tracker.Send(builder.Build());
        }
        public void TrackEvent(string category, string action, string label)
        {
            var builder = new HitBuilders.EventBuilder();

            builder.SetCategory(category);
            builder.SetAction(action);
            builder.SetLabel(label);

            Tracker.Send(builder.Build());
        }
Beispiel #12
0
        public static void TrackAppEvent(String eventCategory, String eventToTrack)
        {
            var builder = new HitBuilders.EventBuilder();

            builder.SetCategory(eventCategory);
            builder.SetAction(eventToTrack);
            builder.SetLabel("AppEvent");

            Rep.Instance.GaTracker.Send(builder.Build());
        }
Beispiel #13
0
        internal static void TrackEvent(string category, string action, string label = "")
        {
#if !DEBUG
            HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder();
            builder.SetCategory(category);
            builder.SetAction(action);
            builder.SetLabel(label);

            GATracker.Send(builder.Build());
#endif
        }
 public void TrackEvent(string category, string title, string eventName)
 {
     if (_tracker != null)
     {
         HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder();
         builder.SetCategory(category);
         builder.SetLabel(title);
         builder.SetAction(eventName);
         _tracker.Send(builder.Build());
     }
 }
Beispiel #15
0
        public void TrackEvent(string category, string eventName, string label = null)
        {
            var builder = new HitBuilders.EventBuilder();

            builder.SetCategory(category);
            builder.SetAction(eventName);
            if (label != null)
            {
                builder.SetLabel(label);
            }

            SetUserId();
            _tracker.Send(builder.Build());
        }
        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);
            }
        }
Beispiel #17
0
        public void TrackEvent(string eventCategory, string eventAction, string eventLabel = "AppEvent", long eventValue = 0)
        {
            if (Verbosity == VerbosityLevel.ReportAll)
            {
                var builder = new HitBuilders.EventBuilder();

                SetUserIDDimension(builder);

                builder.SetCategory(eventCategory);
                builder.SetAction(eventAction);
                builder.SetLabel(eventLabel);

                builder.SetValue(eventValue);

                GATracker.Send(builder.Build());
            }
        }
Beispiel #18
0
        public void sendGaEvent(String action, String category, String label, long?value)
        {
            var gaEvent = new HitBuilders.EventBuilder();

            gaEvent.SetAction(action);
            gaEvent.SetCategory(category);
            gaEvent.SetLabel(label);

            if (value.HasValue)
            {
                gaEvent.SetValue(value.Value);
            }

            var build = gaEvent.Build();

            mGATracker.Send(build.ToDictionary());
        }
Beispiel #19
0
        public void TrackTransaction(string transactionName, string transactionId, long transactionCount = 1)
        {
            if (Verbosity != VerbosityLevel.AnalyticsOff)
            {
                var builder = new HitBuilders.EventBuilder();

                SetUserIDDimension(builder);

                builder.SetCategory("Transactions");
                builder.SetAction(transactionName);
                builder.SetLabel(transactionId);

                builder.SetValue(transactionCount);

                GATracker.Send(builder.Build());
            }
        }
Beispiel #20
0
        static void TrackUnhandledException(Exception ex)
        {
            var builder_ex = new HitBuilders.ExceptionBuilder();

            var errorMessage = CrossAnalytics.Current.ParseException(ex);

            SetUserIDDimension(builder_ex);

            builder_ex.SetDescription(errorMessage);
            builder_ex.SetFatal(true);
            GATracker.Send(builder_ex.Build());

            var builder_ev = new HitBuilders.EventBuilder();

            SetUserIDDimension(builder_ev);

            builder_ev.SetCategory("Crashes");
            builder_ev.SetAction(errorMessage);
            builder_ev.SetLabel(ex.ToString());
            GATracker.Send(builder_ev.Build());
        }
Beispiel #21
0
 public void TrackAppEvent(string Category, string EventAction, string EventLabel)
 {
     try
     {
         if (numOfTrackerEventHitsInThisSession > 300)
         {
             GATracker.Send(new HitBuilders.EventBuilder().SetNewSession().Build());
             numOfTrackerEventHitsInThisSession = 0;
         }
         else
         {
             numOfTrackerEventHitsInThisSession++;
         }
         HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder();
         builder.SetCategory("An_" + Category);
         builder.SetAction("An_" + EventAction);
         builder.SetLabel("An_" + EventLabel);
         GATracker.Send(builder.Build());
     }
     catch { }
 }
        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());
        }
        public void TrackEvent(string category, string action, string label, int value)
        {
            try
            {
                Debug.WriteLine($"{nameof(TrackEvent)}({category}, {action}, {label}, {value})");

                HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder();
                builder.SetCategory(category);
                builder.SetAction(action);
                builder.SetLabel(label);
                builder.SetValue(value);

                GATracker.Send(builder.Build());
            }
            catch (Exception ex)
            {
                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }

                Debug.WriteLine(ex);
            }
        }
Beispiel #24
0
        public void SendEvent(string gaEventCategory, string @event)
        {
            var bla = new HitBuilders.EventBuilder(gaEventCategory, @event);

            _defaultTracker.Send(bla.Build());
        }