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:
- Change device date to 11/9.
- Fresh install app.
- On Explore feed, background app, foreground, then pull to refresh Explore feed to fetch campaign modals.
- Go to developer settings menu, select "bypass donation". Go through Donate flow from Profile to successfully submit a donation.
- Change device date to 11/10 (note campaign dates are in a brief window UTC, so ensure device date matches.
- Visit an article.
- Campaign modal should not show.