mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-24 23:07:36 +08:00
Fix for GA unique_id being regenerated each time.
This commit is contained in:
parent
8008c5f019
commit
cf36e8f3b6
1 changed files with 2 additions and 0 deletions
|
@ -29,6 +29,8 @@ def track_event(category=None, action=None, label=None):
|
|||
try:
|
||||
if settings.analytics.visitor:
|
||||
visitor = pickle.loads(base64.b64decode(settings.analytics.visitor))
|
||||
if visitor.user_agent is None:
|
||||
visitor.user_agent = os.environ.get("SZ_USER_AGENT")
|
||||
if visitor.unique_id > int(0x7fffffff):
|
||||
visitor.unique_id = random.randint(0, 0x7fffffff)
|
||||
except:
|
||||
|
|
Loading…
Reference in a new issue