def _track_update_email_opt_in(user_id, organization, opt_in):
 event_name = ('edx.bi.user.org_email.opted_in' if opt_in else 'edx.bi.user.org_email.opted_out')
 tracking_context = tracker.get_tracker().resolve_context()
 analytics.track(user_id, event_name, {'category': 'communication', 'label': organization}, context={'ip': tracking_context.get('ip'), 'Google Analytics': {'clientId': tracking_context.get('client_id')}})

def _track_update_email_opt_in ( user_id , organization , opt_in ) : event_name = ( 'edx.bi.user.org_email.opted_in' if opt_in else 'edx.bi.user.org_email.opted_out' ) tracking_context = tracker . get_tracker ( ) . resolve_context ( ) analytics . track ( user_id , event_name , { 'category' : 'communication' , 'label' : organization } , context = { 'ip' : tracking_context . get ( 'ip' ) , 'Google Analytics' : { 'clientId' : tracking_context . get ( 'client_id' ) } } )
track an email opt-in preference change .