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

Donate Banner Page still displaying the banner A/B Test after it's done #13320

Open
data-sync-user opened this issue Dec 16, 2024 · 1 comment

Comments

@data-sync-user
Copy link
Collaborator

Report per Grace:
Sharing this mostly as an FYI, but noting that when I go to the page to edit the banner, I'm still seeing the A/B test as "live" this morning, with "keep and end test" and "publish and end test" options available. There was also a gift that came through this morning (7:30am EST) from the "control" variant which should no longer be live. That said, the A/B test dashboard on the wagtail edit page isn't showing much change in the number of people who have viewed the banner since Friday, so even if the testing banners are still being served, it seems to be in a very limited capacity.

The issue seems to be related to this page specifically: https://foundation.mozilla.org/cms/pages/30700/edit/

┆Issue is synchronized with this Jira Bug

@data-sync-user
Copy link
Collaborator Author

➤ Daniel Miranda commented:

Hi Everyone!

After setting up a "dummy" A/B test comparing two different donate banners—both featuring the copy from the winning banner of the actual A/B test—and promptly canceling it, it appears that this bug is no longer occurring.

However, if it happens to occur again, here are the commands that I would run in the heroku bash to delete the historical tests from the CMS memory. Please type/paste these commands in one by one after clicking “Run Console” on the production heroku app page:

  1. cd network-api
  2. python manage.py shell
  3. Import the required models:

from wagtail_ab_testing.models import AbTest
from wagtail.models import Page
from wagtail.models import Locale
from networkapi.donate_banner.models import DonateBannerPage
default_locale = Locale.get_default()

  1. Get the default locale and fetch the donate banner page:

default_locale = Locale.get_default()
donate_banner_page = DonateBannerPage.objects.filter(locale=default_locale).first()
if not donate_banner_page:
print("No DonateBannerPage found.")
else:
print(f"Found DonateBannerPage: {donate_banner_page.title}")

  1. Find all associated A/B tests:

ab_tests = AbTest.objects.filter(page=donate_banner_page).exclude(status=AbTest.STATUS_RUNNING)

if not ab_tests.exists():
print("No historical A/B tests found for this page.")
else:
print(f"Found {ab_tests.count()} historical A/B tests for this page.")

  1. Delete the AB Tests:

ab_tests_count = ab_tests.count()
ab_tests.delete()
print(f"Deleted {ab_tests_count} historical A/B tests associated with the DonateBannerPage.")

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

No branches or pull requests

1 participant