Fix for Google Analytics unique ID issue #539.

pull/550/head
Louis Vézina 5 years ago
parent 7d318117af
commit 5c80278629

@ -27,11 +27,13 @@ def track_event(category=None, action=None, label=None):
tracker = Tracker('UA-138214134-3', 'none', conf=anonymousConfig)
try:
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:
visitor = Visitor()
unique_id = long(random.getrandbits(32))
visitor.unique_id = unique_id
visitor.unique_id = long(random.randint(0, 0x7fffffff))
session = Session()
event = Event(category=category, action=action, label=label, value=1)

Loading…
Cancel
Save