|
|
@ -27,11 +27,13 @@ def track_event(category=None, action=None, label=None):
|
|
|
|
tracker = Tracker('UA-138214134-3', 'none', conf=anonymousConfig)
|
|
|
|
tracker = Tracker('UA-138214134-3', 'none', conf=anonymousConfig)
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
visitor = pickle.loads(base64.b64decode(settings.analytics.visitor))
|
|
|
|
if settings.analytics.visitor:
|
|
|
|
|
|
|
|
visitor = pickle.loads(base64.b64decode(settings.analytics.visitor))
|
|
|
|
|
|
|
|
if visitor.unique_id > int(0x7fffffff):
|
|
|
|
|
|
|
|
visitor.unique_id = random.randint(0, 0x7fffffff)
|
|
|
|
except:
|
|
|
|
except:
|
|
|
|
visitor = Visitor()
|
|
|
|
visitor = Visitor()
|
|
|
|
unique_id = long(random.getrandbits(32))
|
|
|
|
visitor.unique_id = long(random.randint(0, 0x7fffffff))
|
|
|
|
visitor.unique_id = unique_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
session = Session()
|
|
|
|
session = Session()
|
|
|
|
event = Event(category=category, action=action, label=label, value=1)
|
|
|
|
event = Event(category=category, action=action, label=label, value=1)
|
|
|
|