Page MenuHomePhabricator

Hide banners for 250 days after someone has made a donation
Closed, ResolvedPublic2 Estimated Story Points

Description

NOTE: This should be deployed before the launch of Year in Review.

Caveat: This functionality will apply consistently to Native Donations, but cannot be guaranteed for donations made through other payment methods.

  • iOS: For Webpay donations, iOS tracks the impression of the "Thank you page" Webview most of the time, and it only fails sometimes
  • Android: Most WebPay donations from Android are not tracked locally, and Android is only able to track WebPay donations some of the time. This is due to Android's security measures: they prevent us from showing a payment form within an in-app webview. Android is only able to track the impression of the "Thank you page" in Chrome when it's opened in a new tab.
Background

On the web, a cookie is set on the TY page that hides banners within that browser for 250 days. This means anyone who has donated from a web banner or the sidebar donation link does not see banners over the next 250 days.

Current app behavior:

  • Every banner has a unique campaign ID. If the user hasn't seen that campaign ID, we show it. Otherwise we don't. This means that:
    • The app only shows a banner once during a campaign. If someone ignores, donates, or closes, they do not see the banner again.
    • The apps do not hide banners after someone has donated from the app menu (includes the Donate link and other features such as Year in Review). Someone could make an app menu donation right before the banner campaign, and then see a banner during the campaign.
Requirements
  • After someone makes a donation from anywhere in the app, suppress the display of in-app banners (from any campaign ID) for the next 250 days
  • This can leverage local donation history if needed. If they clear their local donation history, it's acceptable for them to be eligible for banners again before 250 days. It's acceptable that not 100% of Web Pay donations are tracked through local donation history (if someone does not navigate back to the App after donating)
Eng Notes
  • We present (and suppress) fundraising campaign modals in ArtilceViewController+Announcements.swift. At this point, we should add a check to see if they last donated < 250 days ago, if so exit early (similar to our opt-in check in this same area).
  • To pull their last donation date, use WMFDonateDataController's loadLocalDonationHistory method.
Test Steps

Can be tested in latest 7.8.6 build.

  • To test campaign modal display, our current production donate config is set to show banners on 11/10, so:
    1. Change device date to 11/9.
    2. Fresh install app.
    3. On Explore feed, background app, foreground, then pull to refresh Explore feed to fetch campaign modals.
    4. Go to developer settings menu, select "bypass donation". Go through Donate flow from Profile to successfully submit a donation.
    5. Change device date to 11/10 (note campaign dates are in a brief window UTC, so ensure device date matches.
    6. Visit an article.
    7. Campaign modal should not show.

Details

Due Date
Mon, Dec 1, 7:00 AM

Event Timeline

HNordeenWMF updated the task description. (Show Details)
HNordeenWMF updated the task description. (Show Details)

Hi, I’d like to kindly request permission to claim this task please let me know if it’s available.

Tsevener updated the task description. (Show Details)
Tsevener added a subscriber: Dbrant.
Tsevener set the point value for this task to 2.Mon, Nov 17, 6:13 PM
HNordeenWMF lowered the priority of this task from High to Medium.Tue, Nov 18, 5:51 PM
HNordeenWMF raised the priority of this task from Medium to High.Tue, Nov 18, 7:32 PM
ABorbaWMF subscribed.

Working for me on 2.7.5058-r-2025-11-19 on OnePlus 8 on Android 13, and Pixel 6 on Android 16.

@Dbrant for Android I'm still seeing a banner after donating on WebPay. I don't think the Thank you page webview is registering in local donation history. After doing these steps, and pressing "Clear donation history" in settings, I get the message "You have no donation history to clear".

Steps to reproduce

  • Fresh install of Beta
  • Set date to Nov 10
  • Turn on Dev Settings, GeoIP = US
  • Open Year in Review
  • Donate
  • "other payment method"
  • Check out with GPay on Web
  • "No thanks" on monthly donation prompt, to show Thank you page
  • Close webview
  • Land back on Year in Review and close
  • Open an English language Wikipedia Article

What happens

  • Banner displays

Expected behavior

  • Banner is suppressed

@Dbrant for Android I'm still seeing a banner after donating on WebPay

Ugh, terribly sorry: I may have been mistaken about our ability to capture the success/failure of web donations, or at least capture them reliably. As you observed in T410182, in certain cases the Web flow leads to a "thank you" page that the app can capture, but other cases lead to a "thank you" page that the app can't capture, i.e. stays in the current browser tab. There is currently no known way around this.
We may need to amend the requirement to be "250 days since the last in-app donation".

Understood, @Dbrant I know you've talked about the unreliability before, but I'm wondering if there's anything we can do to catch more folks? I just checked, and for the last 12 months only 30% of all Android donations were Native GPay (lower than I thought), so I'm not ready to give up on tracking WebPay. Would solving this bug: T410182 also solve the issue here?

Just tested iOS for this task - On iOS my WebPay donations are getting locally stored and do end up suppressing the banner - @Mazevedo at what point does the iOS app capture a WebPay donation as local history? Is it when I see the thankyou.wikipedia.org webiview? Or when I have an impression of the "Thank you" toast in-app.

Just tested iOS for this task - On iOS my WebPay donations are getting locally stored and do end up suppressing the banner - @Mazevedo at what point does the iOS app capture a WebPay donation as local history? Is it when I see the thankyou.wikipedia.org webiview? Or when I have an impression of the "Thank you" toast in-app.

@HNordeenWMF on iOS, we also check for the Thank You page URL, and try to parse the donation info in that URL to save locally

Understood, @Dbrant I know you've talked about the unreliability before, but I'm wondering if there's anything we can do to catch more folks?
Would solving this bug: T410182 also solve the issue here?

Unfortunately it would not. We do not have a fully reliable way of capturing the result of web donations.

Working for me on 7.8.6 (5885). Tested on iPhone 16 on iOS 26, iPad Pro on iPadOS 26, and iPhone 11 on iOS 18.