From d5bebe2149d24361ab1e63509bb0fdd0e52dde9a Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Wed, 16 Dec 2015 13:43:31 -0500 Subject: [PATCH] Add the hostname to mixpanel requests. --- endpoints/trackhelper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/endpoints/trackhelper.py b/endpoints/trackhelper.py index 2b35e4f1d..1905ac86d 100644 --- a/endpoints/trackhelper.py +++ b/endpoints/trackhelper.py @@ -1,6 +1,8 @@ import logging import random +from urlparse import urlparse + from app import analytics, app, userevents from data import model from flask import request @@ -53,9 +55,11 @@ def track_and_log(event_name, repo, analytics_name=None, analytics_sample=1, **k metadata['public'] = True analytics_id = 'anonymous' + request_parsed = urlparse(request.url_root) extra_params = { 'repository': '%s/%s' % (namespace, repository), 'user-agent': request.user_agent.string, + 'hostname': request_parsed.hostname, } # Publish the user event (if applicable)