From 90647628c9774e54665b10536f52b1eca4dd8eef Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Wed, 21 Feb 2018 10:28:03 -0800 Subject: [PATCH] Test sending install metrics on startup --- plexpy/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plexpy/__init__.py b/plexpy/__init__.py index 2212dc0a..e6104475 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -33,6 +33,7 @@ except ImportError: import cherrypy from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.triggers.interval import IntervalTrigger +from UniversalAnalytics import Tracker import activity_handler import activity_pinger @@ -455,6 +456,8 @@ def start(): if CONFIG.FIRST_RUN_COMPLETE: activity_pinger.connect_server(log=True, startup=True) + send_analytics() + _STARTED = True @@ -1668,3 +1671,16 @@ def shutdown(restart=False, update=False, checkout=False): def generate_uuid(): return uuid.uuid4().hex + + +def send_analytics(): + tracker = Tracker.create('UA-111522699-2', client_id=CONFIG.PMS_UUID) + tracker.send('event', { + 'category': 'system', + 'action': 'install', + 'appName': 'Tautulli', + 'appVersion': common.VERSION_NUMBER, + 'appID': '{} {}'.format(common.PLATFORM, common.PLATFORM_VERSION), + 'appInstallerId': plexpy.INSTALL_TYPE, + 'noninteractive': True + })