Ejemplo n.º 1
0
        public void initGA(string options)
        {
            try
            {
                var arguments = CheckAndReturnArguments(2, options);

                if (arguments.Length == 0)
                {
                    return;
                }

                var trackingID = arguments[0];
                var dispatcherTimeInSeconds = int.Parse(arguments[1]);

                InitializeTrackerConfig(trackingID, dispatcherTimeInSeconds);

                Deployment.Current.Dispatcher.BeginInvoke(() => tracker = EasyTracker.GetTracker());

                DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
                return;
            }
            catch (Exception ex)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ex.Message));
                return;
            }
        }
 private Analytics()
 {
     tracker = EasyTracker.GetTracker();
     UndoPressed = 0;
     RedoPressed = 0;
     PhotoSaved = 0;
 }
 public void CloseTracker(Tracker tracker)
 {
     trackers.Remove(tracker.TrackingId);
     if (DefaultTracker == tracker)
     {
         DefaultTracker = null;
     }
 }
 private void InitTracker()
 {
     var analyticsEngine = AnalyticsEngine.Current;
     analyticsEngine.IsDebugEnabled = Config.Debug;
     GAServiceManager.Current.DispatchPeriod = Config.DispatchPeriod;
     tracker = analyticsEngine.GetTracker(Config.TrackingId);
     tracker.SetStartSession(Config.SessionTimeout.HasValue);
     tracker.IsUseSecure = Config.UseSecure;
     tracker.AppName = Config.AppName;
     tracker.AppVersion = Config.AppVersion;
     tracker.IsAnonymizeIpEnabled = Config.AnonymizeIp;
     tracker.SampleRate = Config.SampleFrequency;
 }
Ejemplo n.º 5
0
        public TrackingService()
        {
            WindowsAppInitializer.InitializeAsync();
            _tracker = EasyTracker.GetTracker();

            var bounds = ApplicationView.GetForCurrentView().VisibleBounds;
            var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
            _tracker.AppScreen = new Dimensions((int)(bounds.Width * scaleFactor), (int)(bounds.Height * scaleFactor));
            _tracker.UserAgentOverride = AnalyticsInfo.VersionInfo.DeviceFamily;
            _tracker.SendEvent("device_information", "resolution", (bounds.Width * scaleFactor) + "x" + (bounds.Height * scaleFactor), 0);
            _tracker.SendEvent("device_information", "platform", AnalyticsInfo.VersionInfo.DeviceFamily, 0);

            _client = new TelemetryClient();
        }
 public Tracker GetTracker(string propertyId)
 {
     propertyId = propertyId ?? string.Empty;
     if (!trackers.ContainsKey(propertyId))
     {
         var tracker = new Tracker(propertyId, platformTrackingInfo, this);
         trackers.Add(propertyId, tracker);
         if (DefaultTracker == null)
         {
             DefaultTracker = tracker;
         }
         return tracker;
     }
     else
     {
         return trackers[propertyId];
     }
 }