Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Unintended Donations AB Test #1921

Merged
merged 10 commits into from
Apr 22, 2022

Conversation

yeseniamolinab
Copy link
Contributor

@yeseniamolinab yeseniamolinab commented Apr 15, 2022

Overview

  • Adding an AB test to see if resetting the member details and letting the members fill the details if the id from the URL and the device doesn't match affects donations.
    • Using a custom activation event for Google Optimize instead of page load since we need to control a lot in the code. Using an activation event is one way to do it easily without handling what variant to present to the user (we left that to Google).
    • If the experiment is on the state and the variant one is returned from Google Optimize, and we have an ID mismatch, we reset the member details. Otherwise, we keep everything as is.
  • Added a property called id_mismatch that indicates if the current user's id differs from the recognized member of the AKID on the query string.

Ticket

https://app.asana.com/0/1119304937718815/1202042895794628/f

Videos

Here's a video of variant one when there is data on the cookies about a member and then we have a link with a different AKID.

Loom.Message.-.21.April.2022.mp4

Here's variant 0 with the same scenario described above. Everything remains the same and we show the member's data from the AKID on the URL no matter what.

Loom.Message.-.21.April.2022.1.mp4

@yeseniamolinab yeseniamolinab force-pushed the feature.unintended-donation-abtest-v1 branch from c09518c to 2d4faf2 Compare April 15, 2022 18:35
This reverts commit 4b8e38e.
adding idMismatch to the FE data

fixed ts types

fixed spec

fixed spec

more specs fixes

specs
@yeseniamolinab yeseniamolinab force-pushed the feature.unintended-donation-abtest-v1 branch from 2d4faf2 to 2e374c2 Compare April 18, 2022 19:04
def id_mismatch
return false if recognized_member.nil?

Rails.logger.info("current is '#{current_member}' and recognized is '#{@recognized_member.id}'")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this for debugging/testing purposes and I will remove it in a follow-up PR after I test this on staging.

@@ -0,0 +1,5 @@
export default {
experimentId: 'wXDP1ynuTQKHs6vVvMEj1A',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once the testing is done on staging, I will update the experiment id with the production Id

const variant = window.google_optimize.get(
unintendedDonationsExperiment.experimentId
);
console.log('variant', variant);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this for debugging/testing purposes, and I will remove it in a follow-up PR after testing it on staging.

this.props.experiments.find(
e => (e.experimentId = unintendedDonationsExperiment.experimentId)
) || {};
console.log(this.props);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this for debugging/testing purposes, and I will remove it in a follow-up PR after testing it on staging.

adding experiments to the reducers config

renamed store prop

updated prop

applying variant logic

refactor - use const instead of magic string

fixed spacing

removed blank line

if there is not recognized member then we don't have any mismatch

broken build

raise error for debugging

added log

removed console log
@yeseniamolinab yeseniamolinab force-pushed the feature.unintended-donation-abtest-v1 branch from c7ddcfd to f730351 Compare April 20, 2022 23:46
@yeseniamolinab yeseniamolinab changed the title [WIP] Unintended Donations AB Test Unintended Donations AB Test Apr 21, 2022
@yeseniamolinab yeseniamolinab marked this pull request as ready for review April 21, 2022 00:15
export const SET_VARIANT = 'set_variant';

const initialState = {
experiments: [],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using an array in case we have several experiments running at the same time in the future

@yeseniamolinab yeseniamolinab merged commit df2ba24 into development Apr 22, 2022
@yeseniamolinab yeseniamolinab deleted the feature.unintended-donation-abtest-v1 branch April 22, 2022 16:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants