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

feat(ONYX-1457): add Create Alert Prompt experiment #11346

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

dariakoko
Copy link
Contributor

@dariakoko dariakoko commented Jan 7, 2025

This PR resolves ONYX-1457

Description

Help increase awareness of the Create Alert function from the artist page (high traffic and high impact)
Figma

  1. Implement two variants and control variant
  • control: nothing changes
  • variant-a: popover component
  • variant-b: message components with CTA
  1. For variants a and b the component should be shown:
  • after 40 artworks is loaded
  • max 2 times per user
  • the second time the user will see the popover or message component will be minimum in 7 days
  • when after seeing the component the user clicks "Create Alert" CTA, the popover or message should not be shown again
  1. Make sure the popover component is not shown together with any of the progressive onboarding components at the same time on the same screen

Also adding the payloadSuggestions: ['{"forcePrompt": "true"}', '{"forcePrompt": "false"}'] for testing purposes. Inspired by @anandaroop 🙏

When forcePrompt === true the max times to show the component is 123456 and the waiting time is 30 seconds instead of 3 days. Also, in case of a forced prompt I display a text that says how many times the component has been shown. If the Create Alert CTA was not pressed after seeing the component, on the next render of the component the number will increase by 1. If Create Alert CTA was pressed, the number will be increased by 2. This functionality was added for testing purposes.

iOS

Popover Message
popul.Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-01-08.at.18.38.55.mp4
message.Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-01-08.at.18.38.18.mp4

Android

Popover Message
IMG_7221.MP4
IMG_7220.MP4

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • add Create Alert Prompt experiment (onyx_create-alert-prompt-experiment)

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@dariakoko dariakoko self-assigned this Jan 7, 2025
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Jan 7, 2025

This PR contains the following changes:

  • Cross-platform user-facing changes (add Create Alert Prompt experiment (onyx_create-alert-prompt-experiment) - dariakoko)

Generated by 🚫 dangerJS against 79db47c

@artsyit artsyit force-pushed the dariakoko/ONYX-1457/signal-awareness-and-prominence branch from 41f0661 to ededf25 Compare January 8, 2025 11:56
Comment on lines +25 to +31
/**
* if Create Alert CTA was pressed withing 2 minutes after the prompt was shown
* do not show the prompt again
* */
if (Date.now() - promptState.dismissDate < 120000 && isFocused) {
dontShowCreateAlertPromptAgain()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part is still TDB whether to keep it or not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Barney confirmed this is a good enough approach - if the user interacted with the Create Alert button within 2 minutes after seeing the message or a popover we should not show the message or popover again

Comment on lines +15 to +18
const isOnboardingFinished =
isFocused &&
// make sure threre is no active onboarding popover on the screen
!activePopover
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should not display two popovers on the same screen at the same time, tis is why I am adding this check here.
From my understanding, this is the easiest ways to check if there is an active popover from the progressive onboarding. Not sure if this is the most reliable implementation.. Please, correct me if I am missing something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just noticed that isOnboardingFinished is not a very descriptive name
Should be something like "canDisplayPopover"

Comment on lines 271 to 272
const variant_a = enabled && variant === "variant-a"
const variant_b = enabled && variant === "variant-b"
Copy link
Contributor

Choose a reason for hiding this comment

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

🐪 🐍

Suggested change
const variant_a = enabled && variant === "variant-a"
const variant_b = enabled && variant === "variant-b"
const variantA = enabled && variant === "variant-a"
const variantB = enabled && variant === "variant-b"

const variant_a = enabled && variant === "variant-a"
const variant_b = enabled && variant === "variant-b"

const userDidScroll = artworks.length >= 40
Copy link
Contributor

Choose a reason for hiding this comment

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

This might work at the moment, but it does not precisely determine whether the user has scrolled or not. I think there are three things here we could improve:

  1. Update the logic to either involve the scroll offset or check whether the number of artworks is greater than the initial number of artworks fetched (I'm not 100% sure if this is necessary, though).
  2. Avoid magic numbers.
  3. Change the variable name because the user could have already scrolled when the number of artworks is less than or equal to 40.
Suggested change
const userDidScroll = artworks.length >= 40
const displayCreateAlertPrompt = artworks.length >= CREATE_ALERT_ONBOARDING_OFFSET && artworks.length > INITIAL_NUMBER_OF_ARTWORKS

@@ -288,6 +304,7 @@ const ArtworksGrid: React.FC<ArtworksGridProps> = ({
<ArtistArtworksFilterHeader
artist={artist}
showCreateAlertModal={() => setIsCreateAlertModalVisible(true)}
shouldShowCreateAlertPrompt={!!userDidScroll && variant_a}
Copy link
Contributor

@olerichter00 olerichter00 Jan 9, 2025

Choose a reason for hiding this comment

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

Not sure if prompt (definition: "a request the software makes in order to obtain information from the end user...") is the correct term here. Maybe onboarding tooltip makes more sense 🤔

@@ -9,11 +9,13 @@ import { graphql, useFragment } from "react-relay"
interface ArtistArtworksFilterProps {
artist: ArtistArtworksFilterHeader_artist$key
showCreateAlertModal: () => void
shouldShowCreateAlertPrompt?: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can avoid prop drilling here by using the already existing ProgressiveOnboardingModel's setIsReady functionality.

@@ -0,0 +1,33 @@
import { action, Action } from "easy-peasy"

export interface CreateAlertPromptModel {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the already existing ProgressiveOnboardingModel for this feature?

@@ -57,6 +58,7 @@ interface GlobalStoreStateModel {
requestedPriceEstimates: RequestedPriceEstimatesModel
recentPriceRanges: RecentPriceRangesModel
progressiveOnboarding: ProgressiveOnboardingModel
createAlertPrompt: CreateAlertPromptModel
Copy link
Member

Choose a reason for hiding this comment

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

models should be ideally names instead of verbs. Maybe something like alertPrompt

Copy link
Member

Choose a reason for hiding this comment

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

However, I don't think we should add a new model for this. It might be possible for us to use the existing visual clues model to model this.

We already have addClue and setVisualClueAsSeen. Maybe we can find a way to save the number of times an item has been seen and combine both models into one

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

Successfully merging this pull request may close these issues.

4 participants