def record_goal_attained(experiment_id, user_id, client_id = None):
if not client_id:<EOL><INDENT>client_id = os.environ.get('<STR_LIT>')<EOL><DEDENT>if not client_id:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>response = requests.post(BASE_URL, data={<EOL>'<STR_LIT>': client_id,<EOL>'<STR_LIT>': user_id,<EOL>'<STR_LIT>': experiment_id,<EOL>})<EOL><DEDENT>except requests.ConnectionError:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>val = response.json()<EOL>if val['<STR_LIT:status>'] != '<STR_LIT>':<EOL><INDENT>raise Exception(val['<STR_LIT:message>'])<EOL><DEDENT>return val['<STR_LIT:value>']<EOL>
Record that a variant was successful for a user
@param experiment_id : A single experiment id
@param user_id : An identifier for the user
@param client_id : Bernoulli Client ID