From 9005077793b9fd1c63ad1112422dddf39cd10bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Thu, 28 Nov 2019 23:08:12 -0500 Subject: [PATCH] Some optimization to analytics. --- bazarr/analytics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bazarr/analytics.py b/bazarr/analytics.py index 66157ece8..51e4e3770 100644 --- a/bazarr/analytics.py +++ b/bazarr/analytics.py @@ -40,20 +40,21 @@ def track_event(category=None, action=None, label=None): session = Session() event = Event(category=category, action=action, label=label, value=1) - path = u"/" + u"/".join([category, action, label]) - page = Page(path.lower()) tracker.add_custom_variable(CustomVariable(index=1, name='BazarrVersion', value=os.environ["BAZARR_VERSION"], scope=1)) tracker.add_custom_variable(CustomVariable(index=2, name='PythonVersion', value=platform.python_version(), scope=1)) if settings.general.getboolean('use_sonarr'): tracker.add_custom_variable(CustomVariable(index=3, name='SonarrVersion', value=sonarr_version, scope=1)) + else: + tracker.add_custom_variable(CustomVariable(index=3, name='SonarrVersion', value='unused', scope=1)) if settings.general.getboolean('use_radarr'): tracker.add_custom_variable(CustomVariable(index=4, name='RadarrVersion', value=radarr_version, scope=1)) + else: + tracker.add_custom_variable(CustomVariable(index=4, name='RadarrVersion', value='unused', scope=1)) tracker.add_custom_variable(CustomVariable(index=5, name='OSVersion', value=platform.platform(), scope=1)) try: tracker.track_event(event, session, visitor) - # tracker.track_pageview(page, session, visitor) ## Commented because we were having too much hits on GA. except: pass else: