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)