From 5b6becc63f8c74fdd7f39ce7eb0bed7d5aaeaba9 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 15 Jan 2019 11:19:31 -0500 Subject: [PATCH] remove analytics --- src/Android/Android.csproj | 3 -- .../Services/GoogleAnalyticsService.cs | 41 +------------------ src/iOS.Autofill/iOS.Autofill.csproj | 3 -- .../Services/GoogleAnalyticsService.cs | 30 +------------- src/iOS.Core/iOS.Core.csproj | 5 --- src/iOS.Extension/iOS.Extension.csproj | 3 -- src/iOS/iOS.csproj | 3 -- 7 files changed, 2 insertions(+), 86 deletions(-) diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index 102bba5c4..c1246e57a 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -861,9 +861,6 @@ 60.1142.1 - - 60.1142.1 - 4.4.0 diff --git a/src/Android/Services/GoogleAnalyticsService.cs b/src/Android/Services/GoogleAnalyticsService.cs index c91652d19..7955d1b1b 100644 --- a/src/Android/Services/GoogleAnalyticsService.cs +++ b/src/Android/Services/GoogleAnalyticsService.cs @@ -1,88 +1,49 @@ #if !FDROID using System; -using Bit.App; using Bit.App.Abstractions; using Plugin.Settings.Abstractions; -using Android.Gms.Analytics; using Android.Content; namespace Bit.Android.Services { public class GoogleAnalyticsService : IGoogleAnalyticsService { - private readonly GoogleAnalytics _instance; - private readonly Tracker _tracker; - public GoogleAnalyticsService( Context appContext, IAppIdService appIdService, ISettings settings) - { - _instance = GoogleAnalytics.GetInstance(appContext.ApplicationContext); - _instance.SetLocalDispatchPeriod(10); - - _tracker = _instance.NewTracker("UA-81915606-2"); - _tracker.EnableExceptionReporting(false); - _tracker.EnableAdvertisingIdCollection(true); - _tracker.EnableAutoActivityTracking(true); - _tracker.SetClientId(appIdService.AnonymousAppId); - - var gaOptOut = settings.GetValueOrDefault(Constants.SettingGaOptOut, false); - SetAppOptOut(gaOptOut); - } + { } public void TrackAppEvent(string eventName, string label = null) { - TrackEvent("App", eventName, label); } public void TrackExtensionEvent(string eventName, string label = null) { - TrackEvent("AutofillService", eventName, label); } public void TrackAutofillExtensionEvent(string eventName, string label = null) { - TrackExtensionEvent(eventName, label); } 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); - } - - _tracker.Send(builder.Build()); } public void TrackException(string message, bool fatal) { - var builder = new HitBuilders.ExceptionBuilder(); - builder.SetDescription(message); - builder.SetFatal(fatal); - - _tracker.Send(builder.Build()); } public void TrackPage(string pageName) { - _tracker.SetScreenName(pageName); - _tracker.Send(new HitBuilders.ScreenViewBuilder().Build()); } public void Dispatch(Action completionHandler = null) { - _instance.DispatchLocalHits(); - completionHandler?.Invoke(); } public void SetAppOptOut(bool optOut) { - _instance.AppOptOut = optOut; } } } diff --git a/src/iOS.Autofill/iOS.Autofill.csproj b/src/iOS.Autofill/iOS.Autofill.csproj index dd1af6cae..4c29600c9 100644 --- a/src/iOS.Autofill/iOS.Autofill.csproj +++ b/src/iOS.Autofill/iOS.Autofill.csproj @@ -284,9 +284,6 @@ 4.4.0 - - 3.17.0.1 - 2.0.5782 diff --git a/src/iOS.Core/Services/GoogleAnalyticsService.cs b/src/iOS.Core/Services/GoogleAnalyticsService.cs index 673cb0395..869cc765b 100644 --- a/src/iOS.Core/Services/GoogleAnalyticsService.cs +++ b/src/iOS.Core/Services/GoogleAnalyticsService.cs @@ -1,74 +1,46 @@ using System; using Bit.App.Abstractions; -using Google.Analytics; using Plugin.Settings.Abstractions; namespace Bit.iOS.Core.Services { public class GoogleAnalyticsService : IGoogleAnalyticsService { - private readonly ITracker _tracker; - public GoogleAnalyticsService( IAppIdService appIdService, ISettings settings) - { - Gai.SharedInstance.DispatchInterval = 10; - Gai.SharedInstance.TrackUncaughtExceptions = false; - _tracker = Gai.SharedInstance.GetTracker("UA-81915606-1"); - _tracker.SetAllowIdfaCollection(true); - _tracker.Set(GaiConstants.ClientId, appIdService.AnonymousAppId); - - var gaOptOut = settings.GetValueOrDefault(App.Constants.SettingGaOptOut, false); - SetAppOptOut(gaOptOut); - } + {} public void TrackAppEvent(string eventName, string label = null) { - TrackEvent("App", eventName, label); } public void TrackExtensionEvent(string eventName, string label = null) { - TrackEvent("Extension", eventName, label); } public void TrackAutofillExtensionEvent(string eventName, string label = null) { - TrackEvent("AutofillExtension", eventName, label); } 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(); } public void TrackException(string message, bool fatal) { - var dict = DictionaryBuilder.CreateException(message, fatal).Build(); - _tracker.Send(dict); } public void TrackPage(string pageName) { - _tracker.Set(GaiConstants.ScreenName, pageName); - var dict = DictionaryBuilder.CreateScreenView().Build(); - _tracker.Send(dict); } public void Dispatch(Action completionHandler = null) { - Gai.SharedInstance.Dispatch((result) => - { - completionHandler?.Invoke(); - }); } public void SetAppOptOut(bool optOut) { - Gai.SharedInstance.OptOut = optOut; } } } diff --git a/src/iOS.Core/iOS.Core.csproj b/src/iOS.Core/iOS.Core.csproj index ba09d23f4..9972b60dc 100644 --- a/src/iOS.Core/iOS.Core.csproj +++ b/src/iOS.Core/iOS.Core.csproj @@ -82,10 +82,5 @@ App - - - 3.17.0.1 - - \ No newline at end of file diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index a0e98ba16..fa062f368 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -284,9 +284,6 @@ 4.4.0 - - 3.17.0.1 - 2.0.5782 diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj index 05d626bc4..991afa6b6 100644 --- a/src/iOS/iOS.csproj +++ b/src/iOS/iOS.csproj @@ -710,9 +710,6 @@ 4.4.0 - - 3.17.0.1 - 2.0.5782