Skip to content

Commit 37b6032

Browse files
committed
Add client ID to Google Analytics requests
1 parent ebf0987 commit 37b6032

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

readthedocs/analytics/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def anonymize_user_agent(user_agent):
5757

5858
def send_to_analytics(data):
5959
"""Sends data to Google Analytics"""
60+
if data.get('uip') and data.get('ua'):
61+
data['cid'] = generate_client_id(data['uip'], data['ua'])
62+
6063
if 'uip' in data:
6164
# Anonymize IP address if applicable
6265
data['uip'] = anonymize_ip_address(data['uip'])

0 commit comments

Comments
 (0)