Add the hostname to mixpanel requests.
This commit is contained in:
parent
f228a0b13a
commit
d5bebe2149
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Reference in a new issue