mirror of
https://github.com/bitwarden/mobile
synced 2025-12-22 11:13:49 +00:00
Remove userid from Ga service, not being used
This commit is contained in:
@@ -9,7 +9,6 @@ namespace Bit.iOS.Core.Services
|
||||
{
|
||||
private readonly ITracker _tracker;
|
||||
private readonly IAuthService _authService;
|
||||
private bool _setUserId = true;
|
||||
|
||||
public GoogleAnalyticsService(
|
||||
IAppIdService appIdService,
|
||||
@@ -24,16 +23,10 @@ namespace Bit.iOS.Core.Services
|
||||
_tracker.SetAllowIdfaCollection(true);
|
||||
_tracker.Set(GaiConstants.ClientId, appIdService.AnonymousAppId);
|
||||
|
||||
var gaOptOut = settings.GetValueOrDefault(App.Constants.SettingGAOptOut, false);
|
||||
var gaOptOut = settings.GetValueOrDefault(App.Constants.SettingGaOptOut, false);
|
||||
SetAppOptOut(gaOptOut);
|
||||
}
|
||||
|
||||
public void RefreshUserId()
|
||||
{
|
||||
_tracker.Set(GaiConstants.UserId, null);
|
||||
_setUserId = true;
|
||||
}
|
||||
|
||||
public void TrackAppEvent(string eventName, string label = null)
|
||||
{
|
||||
TrackEvent("App", eventName, label);
|
||||
@@ -46,7 +39,6 @@ namespace Bit.iOS.Core.Services
|
||||
|
||||
public void TrackEvent(string category, string eventName, string label = null)
|
||||
{
|
||||
SetUserId();
|
||||
var dict = DictionaryBuilder.CreateEvent(category, eventName, label, null).Build();
|
||||
_tracker.Send(dict);
|
||||
Gai.SharedInstance.Dispatch();
|
||||
@@ -54,14 +46,12 @@ namespace Bit.iOS.Core.Services
|
||||
|
||||
public void TrackException(string message, bool fatal)
|
||||
{
|
||||
SetUserId();
|
||||
var dict = DictionaryBuilder.CreateException(message, fatal).Build();
|
||||
_tracker.Send(dict);
|
||||
}
|
||||
|
||||
public void TrackPage(string pageName)
|
||||
{
|
||||
SetUserId();
|
||||
_tracker.Set(GaiConstants.ScreenName, pageName);
|
||||
var dict = DictionaryBuilder.CreateScreenView().Build();
|
||||
_tracker.Send(dict);
|
||||
@@ -75,15 +65,6 @@ namespace Bit.iOS.Core.Services
|
||||
});
|
||||
}
|
||||
|
||||
private void SetUserId()
|
||||
{
|
||||
if(_setUserId && _authService.IsAuthenticated)
|
||||
{
|
||||
_tracker.Set(GaiConstants.UserId, _authService.UserId);
|
||||
_setUserId = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAppOptOut(bool optOut)
|
||||
{
|
||||
Gai.SharedInstance.OptOut = optOut;
|
||||
|
||||
Reference in New Issue
Block a user