Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Privacy: teacher sign-up has email preference #22283

Merged
merged 2 commits into from May 10, 2018

Conversation

breville
Copy link
Member

@breville breville commented May 9, 2018

Teacher sign-up now has an option to choose email preference. A choice is not required to submit the form at this time. Choosing "yes" or "no" writes the choice as an EmailPreference, while choosing neither does not write an EmailPreference.

The option is shown as a drop-down, though a hidden alternative uses radio buttons. An A/B test is able to show this alternative using something like this:

  $("#optin-container").remove();
  $("#optin2-container").show();

This change also loads Optimizely on the sign-up page.

dropdown

screenshot 2018-05-09 11 27 00

radio button alternative

screenshot 2018-05-09 11 26 13

Teacher sign-up now has an option to choose email preference.  A choice is not required to submit the form at this time, but not choosing "yes" will default to an email preference opt-in choice of "no".

The option is shown as a drop-down, though a hidden alternative uses radio buttons.  An A/B test is able to show this alternate using something like this:

  $("#optin-container").remove();
  $("#optin2-container").show();
email: params[:user][:email],
opt_in: optin_value,
ip_address: request.env['REMOTE_ADDR'],
source: "Teacher account sign up",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After I merge #22277, this would change to EmailPreference::REGISTRATION

@tanyaparker
Copy link
Contributor

@breville Just confirming that for the radio button the default is neither selected?

@poorvasingal is it desired behavior that selecting neither Yes/No submits them as No? Can't we continue to keep it as NULL like past signups? That way we can also track what percentage of people are completing this question as well as the percentage of people who say Yes/No?

@breville
Copy link
Member Author

breville commented May 9, 2018

@tanyaparker Correct, neither radio button is selected by default, and the form can be submitted with neither selected.

@tanyaparker
Copy link
Contributor

Oh I thought in your description but not choosing "yes" will default to an email preference opt-in choice of "no". meant not answering = "no"

@breville
Copy link
Member Author

breville commented May 9, 2018

Not answering does mean recording their opt-in choice as "no" in the database, though subject to the full business logic in #22277. I was just answering the first question about radio button behaviour. :)

@tanyaparker
Copy link
Contributor

Oh ok, thanks for clarifying. Will wait to hear Poorva's preference for what we save in the DB when they don't answer.

@poorvasingal
Copy link
Contributor

@sureshc mentioned that we * have * to submit a "Yes" or a "No." That's a bummer, because I agree with you Tanya that I'd want to know how many people are leaving this blank. My guess is that we're going to get a lot of "Nos" just because people aren't filling out this question.

How widely are we releasing this? To everyone in the US? We should make sure we don't test this in the EU yet since we can't yet track what text they saw when opting in.

@sureshc
Copy link
Contributor

sureshc commented May 9, 2018

@breville You could skip invoking EmailPreference.upsert! when the user has not answered yes or no. A query of all teachers who registered after this question was added to the form, outer joined to email_preferences by email address would then get a list of yes/no/didn't-answer teachers.

@sureshc sureshc closed this May 9, 2018
@sureshc sureshc reopened this May 9, 2018
@tanyaparker
Copy link
Contributor

Gotcha, Poorva. Since it's a technical limitation, no worries.

@poorvasingal
Copy link
Contributor

Sounds like we will still have a way to see how many people aren't answering? yay, thanks for checking Suresh!

@breville
Copy link
Member Author

breville commented May 9, 2018

Ah, this is good information. In this case I'll hide the email preference option completely and we will have to show the one we want using Optimizely, targeting at US visitors. I'll also update so that we only write to EmailPreference if we get an explicit yes or no.

@breville
Copy link
Member Author

breville commented May 9, 2018

Update: we will rely on Optimizely to show variants for US users, and will use it to determine success rate of the variants. Non-US users will see the strings as shown in the screenshots in this PR, with no variants, and we will record "yes" (if they choose "yes") or "no" (if they choose "no" or ignore the option), and we will record the "form_kind as "0" so that we know which option UI they were presented with.

@breville
Copy link
Member Author

Update: we will rely on Optimizely to show variants for US users, and will use it to determine success rate of the variants. Non-US users will see the strings as shown in the screenshots in this PR, with no variants. We will record "yes" if they choose "yes", "no" if they choose "no", and will not write anything to EmailPreference if they ignore the option. We will record the "form_kind as "0" so that we know which options they were presented with.

email: params[:user][:email],
opt_in: optin_value,
ip_address: request.env['REMOTE_ADDR'],
source: "Teacher account sign up",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged #22277. If you pull the latest staging and merge into this branch you can change this to:

source: EmailPreference::ACCOUNT_SIGN_UP,

Here's the full list of source types based on @poorvasingal 's comment last night:

SOURCE_TYPES = [
ACCOUNT_SIGN_UP = 'Teacher account sign up',
ACCOUNT_TYPE_CHANGE = 'Student account change to teacher',
ACCOUNT_EMAIL_ADD = 'Add email to teacher account',
ACCOUNT_EMAIL_CHANGE = 'Update teacher account email',
FORM_HOUR_OF_CODE = 'Host Hour of Code form',
FORM_VOLUNTEER = 'Volunteer form'
].freeze

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I want to get this change in today so we can start a/b testing immediately but will make this fix in a follow-up.

@breville breville merged commit 9d44435 into staging May 10, 2018
@breville breville deleted the privacy-teacher-sign-up-email-preference branch May 10, 2018 17:08
@tanyaparker
Copy link
Contributor

Where are we storing the strings that the user sees? Not sure if I understood your comment correctly. If non-US answers and we save them as form_kind = 0, that means they had the 0th version of the string? How will we know what the actual string was?

@breville
Copy link
Member Author

Non-US users will see the string that's in our source code. I'm just using 0 as the reference for the default string as we are first shipping this UI to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants