Beispiel #1
0
        public void TrackEvent(
            EventData eventData,
            List <CustomDimension> customDimensions,
            List <CustomMetric> customMetrics
            )
        {
            var builder = DictionaryBuilder.CreateEvent(
                eventData.EventCategory,
                eventData.EventAction,
                !string.IsNullOrWhiteSpace(eventData.EventLabel) ? eventData.EventLabel : string.Empty,
                new NSNumber(eventData.Id)
                );

            if (customDimensions?.Count > 0)
            {
                foreach (var customDimension in customDimensions)
                {
                    builder.Set(customDimension.DimensionValue, Fields.CustomDimension((nuint)customDimension.DimensionIndex));
                }
            }

            if (customMetrics?.Count > 0)
            {
                foreach (var customMetric in customMetrics)
                {
                    builder.Set(Convert.ToString(customMetric.MetricValue), Fields.CustomMetric((nuint)customMetric.MetricIndex));
                }
            }


            analyticsTracker.Send(builder.Build());
        }
        public void TrackEvent(string category, string eventName, string label = null)
        {
            var dict = DictionaryBuilder.CreateEvent(category, eventName, label, null).Build();

            _tracker.Send(dict);
            Gai.SharedInstance.Dispatch();
        }
Beispiel #3
0
        public void TrackEvent(string category, string eventName, Boolean online)
        {
            string action = (online ? "" : OFFLINE) + " - " + eventName;

            Gai.SharedInstance.DefaultTracker.Set(GaiConstants.Event, action);
            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent(category, action, null, null).Build());
        }
Beispiel #4
0
 public void SendEvent(string category, string action, string label, long?value)
 {
     Gai.SharedInstance.DefaultTracker.Send(
         DictionaryBuilder.CreateEvent(category,
                                       action,
                                       label,
                                       value.HasValue ? NSNumber.FromLong((nint)value) : null).Build());
 }
Beispiel #5
0
 public void TrackUserId(string userid)
 {
     if (!string.IsNullOrWhiteSpace(userid))
     {
         analyticsTracker.Set(GaiConstants.UserId.ToString(), userid);
         var builder = DictionaryBuilder.CreateEvent("TrackUserId", "TrackUserId", "", new NSNumber(0));
         analyticsTracker.Send(builder.Build());
     }
 }
        public void TrackEvent(string eventCategory, string eventAction, string eventLabel = "AppEvent", long eventValue = 0)
        {
            if (Verbosity == VerbosityLevel.ReportAll)
            {
                SetUserIDDimension();

                Tracker.Send(DictionaryBuilder.CreateEvent(eventCategory, eventAction, eventLabel, eventValue).Build());
                Gai.SharedInstance.Dispatch();
            }
        }
        static void TrackUnhandledException(Exception ex)
        {
            SetUserIDDimension();

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

            Tracker.Send(DictionaryBuilder.CreateException(errorMessage, true).Build());
            Tracker.Send(DictionaryBuilder.CreateEvent("Crashes", errorMessage, ex.ToString(), null).Build());
            Gai.SharedInstance.Dispatch();
        }
        public void TrackTransaction(string transactionName, string transactionId, long transactionCount = 1)
        {
            if (Verbosity != VerbosityLevel.AnalyticsOff)
            {
                SetUserIDDimension();

                Tracker.Send(DictionaryBuilder.CreateEvent("Transactions", transactionName, transactionId, transactionCount).Build());
                Gai.SharedInstance.Dispatch();
            }
        }
        public override void TrackEvent(string category, string action, string label = null)
        {
            var eventBuilder = DictionaryBuilder.CreateEvent(category, action, string.IsNullOrEmpty(label) ? "" : label,
                                                             null);

            if (CustomDimensions != null)
            {
                foreach (var key in CustomDimensions.Keys)
                {
                    Tracker.Set(Fields.CustomDimension((nuint)key), CustomDimensions[key]);
                }
            }

            Tracker.Send(eventBuilder.Build());
        }
Beispiel #10
0
        partial void BtnApplyNow_TouchUpInside(UIButton sender)
        {
            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent("Job Search", "Apply_button_press", "AppEvent", null).Build());
            Gai.SharedInstance.Dispatch();     // Manually dispatch the event immediately // just for demonstration // not much recommended

            //UIApplication.SharedApplication.OpenUrl(new NSUrl(this.aJobDetail.ApplyUri));

            //var sfViewController = new SFSafariViewController(new NSUrl(this.aJobDetail.ApplyUri));
            //PresentViewControllerAsync(sfViewController, true);

            UIStoryboard storyboard         = UIStoryboard.FromName("Phone", null);
            var          _webViewController = (WebViewController)storyboard.InstantiateViewController("WebViewController");

            _webViewController.urlString  = this.aJobDetail.ApplyUri;
            _webViewController.isJobApply = true;
            this.NavigationController.PushViewController(_webViewController, true);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Create a GA event and dispatch it to GA.
            NavigationItem.LeftBarButtonItem = new UIBarButtonItem("Dispatch", UIBarButtonItemStyle.Plain, (s, e) => {
                var gaEvent = DictionaryBuilder.CreateEvent("UI", "buttonPress", "dispatch", null).Build();
                Gai.SharedInstance.DefaultTracker.Send(gaEvent);
                Gai.SharedInstance.Dispatch();
                Console.WriteLine("Event Sent, Check Google's GA Event Console");
            });

            // Create a Crash
            NavigationItem.RightBarButtonItem = new UIBarButtonItem("Crash", UIBarButtonItemStyle.Plain, (s, e) => {
                var obj = new NSObject();
                obj.PerformSelector(new Selector("doesNotRecognizeSelector"), obj, 0);
            });
        }
        public void LogEvent(string name, string category, string eventName, string eventData)
        {
            if (Enabled && _tracker != null)
            {
                _tracker.Set(GaiConstants.ScreenName, name);

                _tracker.Send(
                    DictionaryBuilder.CreateEvent(
                        category,
                        eventName,
                        eventData,
                        null
                        )
                    .Build()
                    );

                _tracker.Set(GaiConstants.ScreenName, null);
            }
        }
        public void LogViewDisplayed(string name)
        {
            if (Enabled && _tracker != null)
            {
                _tracker.Set(GaiConstants.ScreenName, name);

                _tracker.Send(
                    DictionaryBuilder.CreateEvent(
                        Constants.Tracking.UserInterfaceEvent,
                        Constants.Tracking.ViewDisplayed,
                        name,
                        null
                        )
                    .Build()
                    );

                _tracker.Set(GaiConstants.ScreenName, null);
            }
        }
Beispiel #14
0
        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 void TrackEvent(string category, string action, string label, int value)
        {
            try
            {
                Debug.WriteLine($"{nameof(TrackEvent)}({category}, {action}, {label}, {value})");

                Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent(category, action, label, value).Build());
                Gai.SharedInstance.Dispatch(); // Manually dispatch the event immediately
            }
            catch (Exception ex)
            {
                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }

                Debug.WriteLine(ex);
            }
        }
Beispiel #16
0
        partial void FilterButton_TouchUpInside(UIButton sender)
        {
            if (!Constants.jobSearchResponse.ContainsKey("presentationFacetResultList"))
            {
                var alert = UIAlertController.Create("Adecco", "Oops! Something went wrong!", UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                PresentViewController(alert, animated: true, completionHandler: null);
                return;
            }

            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent("Job Search", "Refine_button_press", "AppEvent", null).Build());
            Gai.SharedInstance.Dispatch();             // Manually dispatch the event immediately // just for demonstration // not much recommended
            this.isLoadingMoreData = false;

            var _refineViewController = (RefineViewController)Storyboard.InstantiateViewController("RefineViewController");

            _refineViewController.presentationFacetResultList = Constants.jobSearchResponse["presentationFacetResultList"];
            _refineViewController.jobRequest = this.aJobRequest;

            this.NavigationController.PushViewController(_refineViewController, true);
        }
#pragma warning disable RECS0165 // Asynchronous methods should return a Task instead of void
        private async void geoCodeLocation(string location)
#pragma warning restore RECS0165 // Asynchronous methods should return a Task instead of void

        {
            NetworkStatus remoteHostStatus = Reachability.RemoteHostStatus();

            if (remoteHostStatus == NetworkStatus.NotReachable)
            {
                var alert = UIAlertController.Create("Network Error", "Please check your internet connection", UIAlertControllerStyle.Alert);
                alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                PresentViewController(alert, animated: true, completionHandler: null);

                return;
            }

            BTProgressHUD.Show("Loading...", -1, ProgressHUD.MaskType.Black);

            //AsyncGeocodeLocation
            ServiceManager jobService = new ServiceManager();

            string latLong = await jobService.AsyncGeocodeLocation(location);

            Console.WriteLine(latLong);

            if (!string.IsNullOrEmpty(latLong))
            {
                Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent("Job Search", "JobSearch_button_press", "AppEvent", null).Build());
                Gai.SharedInstance.Dispatch();                 // Manually dispatch the event immediately // just for demonstration // not much recommended


                // Add recent search in local DB.
                this.AddRecentSearchData();

                // Get job search result based on input keyword and location
                GetJobSearchData(this.txtKeyword.Text.Trim(), this.txtLocation.Text.Trim());
            }
            else
            {
                BTProgressHUD.Dismiss();
            }
        }
Beispiel #18
0
 public void TrackAppEvent(string Category, string EventAction, string EventLabel)
 {
     try
     {
         if (numOfTrackerEventHitsInThisSession > 300)
         {
             Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build());
             Gai.SharedInstance.Dispatch(); // Manually dispatch the event immediately
             numOfTrackerEventHitsInThisSession = 0;
         }
         else
         {
             numOfTrackerEventHitsInThisSession++;
         }
         Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent("iOS_" + Category, "iOS_" + EventAction, "iOS_" + EventLabel, null).Build());
         Gai.SharedInstance.Dispatch(); // Manually dispatch the event immediately
     }
     catch
     {
     }
 }
 public void TrackEvent(string eventType, string eventName, string label = null)
 {
     Tracker?.Send(DictionaryBuilder.CreateEvent(eventType, eventName, label, null).Build());
 }
 public void RastrearEvento(string categoria, string evento)
 {
     Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent(categoria, evento, "AppEvent", null).Build());
     Gai.SharedInstance.Dispatch(); // Manually dispatch the event immediately
 }
Beispiel #21
0
 public void Track_App_Event(String GAEventCategory, String EventToTrack)
 {
     Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent(GAEventCategory, EventToTrack, "AppEvent", null).Build());
     Gai.SharedInstance.Dispatch();             // Manually dispatch the event immediately
 }
 public void CreateEvent(GaEventMessage message)
 {
     Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent(message.Category, message.Action, message.Label, message.Number).Build());
 }
Beispiel #23
0
 public void SendEvent(string gaEventCategory, string @event)
 {
     Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent(gaEventCategory, @event, "AppEvent", null).Build());
     Gai.SharedInstance.Dispatch(); // Manually dispatch the event immediately
 }
Beispiel #24
0
        void FavoriteButtonWithCount(UINavigationItem navItem)
        {
            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent("Job Search", "Favorate_button_press", "AppEvent", null).Build());
            Gai.SharedInstance.Dispatch();             // Manually dispatch the event immediately // just for demonstration // not much recommended



            if (isFavoriteJob)
            {
                return;
            }


            List <JobCMS> favJobList = DbHelper.GetFavoriteJobs();
            int           favCount   = 0;

            if (favJobList != null)
            {
                favCount = favJobList.Count;
            }


            UIButton btn = new UIButton(UIButtonType.Custom);

            btn.Frame                     = new RectangleF(0, 0, 40, 40);
            btn.TouchUpInside            += FavoriteButtonPressed;
            btn.ShowsTouchWhenHighlighted = true;

            UILabel lbl = new UILabel();

            lbl.Frame         = new RectangleF(19, 0, 20, 20);
            lbl.Text          = favCount.ToString();
            lbl.TextAlignment = UITextAlignment.Center;
            lbl.TextColor     = UIColor.Red;

            if (favCount < 10)
            {
                lbl.Font = UIFont.BoldSystemFontOfSize(14);
            }

            else
            {
                lbl.Font = UIFont.BoldSystemFontOfSize(12);
            }

            if (favCount == 0)
            {
                btn.SetImage(UIImage.FromBundle("favicon-unselected"), UIControlState.Normal);
            }
            else
            {
                btn.SetImage(UIImage.FromBundle("Badge"), UIControlState.Normal);
                btn.AddSubview(lbl);
            }

            UIBarButtonItem barButton2 = new UIBarButtonItem(btn);

            navItem.RightBarButtonItem = barButton2;

            SearchResultVC.favAnimation(this, lbl, true, 0.3f, null);
        }
        public void TrackEvent(string category, string eventName, string label)
        {
            var builder = DictionaryBuilder.CreateEvent(category, eventName, "label", null);

            _tracker.Send(builder.Build());
        }
Beispiel #26
0
        #pragma warning disable RECS0165 // Asynchronous methods should return a Task instead of void
        private async void getBranchList()
        #pragma warning restore RECS0165 // Asynchronous methods should return a Task instead of void
        {
            NetworkStatus remoteHostStatus = Reachability.RemoteHostStatus();

            if (remoteHostStatus == NetworkStatus.NotReachable)
            {
                var alert = UIAlertController.Create("Network Error", "Please check your internet connection", UIAlertControllerStyle.Alert);
                alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                PresentViewController(alert, animated: true, completionHandler: null);

                return;
            }

            //BTProgressHUD.Show("Searching Branches...", -1, ProgressHUD.MaskType.Black);

            //Console.WriteLine("JobLocations ==> {0}",DbHelper.JobLocations);

            BranchRequest _branchRequest = new BranchRequest();

            _branchRequest.Latitude  = Constants.Latitude;
            _branchRequest.Longitude = Constants.Longitude;
            _branchRequest.Radius    = ConfigManager.BLRadius;

            if (!string.IsNullOrEmpty(Constants.Latitude))
            {
                _branchRequest.Latitude = Constants.Latitude;
            }

            if (!string.IsNullOrEmpty(Constants.Longitude))
            {
                _branchRequest.Longitude = Constants.Longitude;
            }

            if (!string.IsNullOrEmpty(this.txtDistance.Text))
            {
                String[] splitstring = txtDistance.Text.Split(' ');
                _branchRequest.Radius = splitstring[0];
            }


            _branchRequest.RadiusUnits = "KM";
            _branchRequest.Industry    = "ALL";
            _branchRequest.MaxResults  = ConfigManager.BLMaxResultCount;

            ServiceManager jobService = new ServiceManager();

            List <Branch> _branchList = await jobService.AsyncBranchLocator(_branchRequest);

            //Console.WriteLine(_branchList);
            BTProgressHUD.Dismiss();


            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent("Branch Search", "BranchSearch_button_press", "AppEvent", null).Build());
            Gai.SharedInstance.Dispatch();             // Manually dispatch the event immediately // just for demonstration // not much recommended


            AppDelegate  appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate;
            UIStoryboard storyboard  = UIStoryboard.FromName(appDelegate.storyboard, null);

            var _aBranchListVC = (BranchListVC)storyboard.InstantiateViewController("BranchListVC");

            _aBranchListVC._branchList = _branchList;
            this.NavigationController.PushViewController(_aBranchListVC, true);
        }
Beispiel #27
0
 protected override void SendEvent(string category, string action, string label = null, long value = 0)
 {
     SendHit(DictionaryBuilder.CreateEvent(category, action, label, value));
 }
Beispiel #28
0
 public override void TrackEvent(string category, string action, string label)
 {
     _sharedTracker.Send(DictionaryBuilder.CreateEvent(category, action, label, null).Build());
 }