Add IP to all python Segment tracking calls

This commit is contained in:
Bill DeRusha
2015-09-30 10:58:07 -04:00
parent e0c430ffe3
commit ca6633bd98
12 changed files with 20 additions and 4 deletions

View File

@@ -1062,6 +1062,7 @@ class CourseEnrollment(models.Model):
'run': self.course_id.run,
'mode': self.mode,
}, context={
'ip': tracking_context.get('ip'),
'Google Analytics': {
'clientId': tracking_context.get('client_id')
}

View File

@@ -1179,6 +1179,7 @@ def login_user(request, error=""): # pylint: disable=too-many-statements,unused
'provider': None
},
context={
'ip': tracking_context.get('ip'),
'Google Analytics': {
'clientId': tracking_context.get('client_id')
}
@@ -1635,6 +1636,7 @@ def create_account_with_params(request, params):
'provider': third_party_provider.name if third_party_provider else None
},
context={
'ip': tracking_context.get('ip'),
'Google Analytics': {
'clientId': tracking_context.get('client_id')
}

View File

@@ -604,6 +604,7 @@ def login_analytics(strategy, auth_entry, *args, **kwargs):
'provider': getattr(kwargs['backend'], 'name')
},
context={
'ip': tracking_context.get('ip'),
'Google Analytics': {
'clientId': tracking_context.get('client_id')
}