wagtail-nest / wagtail-ab-testing Goto Github PK
View Code? Open in Web Editor NEWA/B testing for Wagtail
License: Other
A/B testing for Wagtail
License: Other
It seems that c3.js
won't be maintained anymore and will be replaced by billboard.js
(see https://github.com/naver/billboard.js/wiki/Why-we-decided-to-start-billboard.js%3F). We should decide on whether to migrate to billboard
or another solution.
@salty-ivy running the tests is not that well documented in the readme, here is how I did it.
Assuming you are inside a virtualenv
# Install wagtail-ab-testing in editable mode along with its testing dependencies
pip install -e ".[testing]"
# Run the tests
python testmanage.py test
Originally posted by @Stormheg in #53 (comment)
Cc: @Stormheg
We should add small developer section in readme.
that should at least documents how to install the repo locally and runtests.
this would include this repo to the scope of new upcoming contributors.
The screenshot no longer matches what the form looks like now that #80 is merged
It appears there is a yellowish haze on all screenshots as well, might be a good opportunity to correct that as well.
The requirements got bumped to support wagtail 2.14, but it looks like no associated version bump got pushed out to PyPI, which is still on 0.4 (and thus only supports up to 2.11)
After failing to get ab testing working on an existing wagtail project, I tried following the installation steps for a minimal project, with no more luck.
The installation itself works fine, the migrations run without issues and i can successfully create an A/B test. It also seems to correctly track unique visitors for the page under test. However, it seems that successful conversions (page visits of a goal page) are never picked up. I checked the django views where the conversions are supposed to be picked up, but those are never called. My best guess so far is that there's something going wrong in the tracker JS, but i'm at a loss what the issue might be.
I think this might be a bug or slight hitch in documentation on wagtail-ab-testing's side, but i pushed my minimal project setup to a separate repo, in the hopes this will help point to the reason for the issue
I am trying to use this new awesome features but get the following error: TypeError: can_be_triggered_on_page_type() missing 1 required positional argument: 'page_type'
. Callback traces to here:
My wagtail_hooks.py
looks like this:
from wagtail.core import hooks
from wagtail_ab_testing.events import BaseEvent
from .models import ProductDetailPage
class ExternalLinkClickEvent(BaseEvent):
name = "External Link Click"
def get_page_types(self):
return [
ProductDetailPage,
]
@hooks.register('register_ab_testing_event_types')
def register_external_link_click_event_type():
return {
'external-link-click': ExternalLinkClickEvent,
}
In my models.py file, I was planning to use RoutablePageMixin
with a custom route and javascript call on button click to trigger a request to the route to log any potential conversion. Not sure how the javascript part works yet or what the best solution would be?
class ProductDetailPage(MetadataPageMixin, RoutablePageMixin, Page):
"""
A generic product detail page.
"""
product_primary_cta_link = models.URLField(
help_text='Link to docassemble interview',
blank=True,
null=True
)
# other Fields...
@route(r'^external_link_clicked/$')
def external_link_clicked(self, request, *args, **kwargs):
"""
View function for tracking click to external link.
"""
# Check if the user is trackable
if request_is_trackable(request):
# Check if the page is the goal of any running tests
tests = AbTest.objects.filter(goal_event='external-link-click', goal_page=self, status=AbTest.STATUS_RUNNING)
for test in tests:
# Is the user a participant in this test?
if f'wagtail-ab-testing_{test.id}_version' not in request.session:
continue
# Has the user already completed the test?
if f'wagtail-ab-testing_{test.id}_completed' in request.session:
continue
# Log a conversion
test.log_conversion(request.session[f'wagtail-ab-testing_{test.id}_version'])
request.session[f'wagtail-ab-testing_{test.id}_completed'] = 'yes'
Any help would be very much appreciated! Thanks 🙏
As requested by Will E at Mozilla, this would make reporting easier and should be fairly straightforward without breaking designs.
The JS dependencies seem to be quite out-of-date.
The Wagtail 3.0 first release candidate is out. There are large UI changes in this release, for which we have reviewed expected breakage in third-party UI customisations.
This is beyond what we do with our normal breaking changes policy, since the majority of those changes are on parts of Wagtail that haven’t been publicly supported / documented in any way. To make sure this goes smoothly anyway, I’m here to provide an advance notice of what we’re aware of with this specific package 🙂
For this package, there are no confirmed issues, but we would recommend taking a look at any reuse of core templates:
torchbox/wagtail-ab-testing/wagtail_ab_testing/templates/wagtail_ab_testing/compare.html
1:{% extends "wagtailadmin/base.html" %}
7: {% include "wagtailadmin/shared/header.html" with title=title subtitle=page.title tabbed=1 merged=1 %}
torchbox/wagtail-ab-testing/wagtail_ab_testing/templates/wagtail_ab_testing/add_compare.html
1:{% extends "wagtailadmin/base.html" %}
7: {% include "wagtailadmin/shared/header.html" with title=title subtitle=page.title icon='people-arrows' tabbed=1 merged=1 %}
torchbox/wagtail-ab-testing/wagtail_ab_testing/templates/wagtail_ab_testing/results.html
1:{% extends "wagtailadmin/base.html" %}
7: {% include "wagtailadmin/shared/header.html" with title=title icon='people-arrows' tabbed=1 merged=1 %}
126: {% include "wagtailadmin/pages/_editor_js.html" %}
torchbox/wagtail-ab-testing/wagtail_ab_testing/templates/wagtail_ab_testing/report.html
1:{% extends 'wagtailadmin/reports/base_report.html' %}
torchbox/wagtail-ab-testing/wagtail_ab_testing/templates/wagtail_ab_testing/add_form.html
1:{% extends "wagtailadmin/base.html" %}
7: {% include "wagtailadmin/shared/header.html" with title=title subtitle=page.title icon='people-arrows' tabbed=1 merged=1 %}
19: {% include "wagtailadmin/shared/field_as_li.html" with field=form.name %}
20: {% include "wagtailadmin/shared/field_as_li.html" with field=form.hypothesis %}
44: {% include "wagtailadmin/shared/field_as_li.html" with field=form.sample_size %}
66: {% include "wagtailadmin/pages/_editor_css.html" %}
70: {% include "wagtailadmin/pages/_editor_js.html" %}
In particular, the header template no longer supports the tabbed
attribute.
The UserPagePermissionProxy
class was deprecated in Wagtail 5.1 and will be removed in Wagtail 6: https://docs.wagtail.org/en/stable/releases/5.1.html#userpagepermissionsproxy-is-deprecated
It is used here:
We should consider backwards compatibility with older versions of Wagtail when fixing this.
This is a counterpart for issue wagtail/wagtail#10678 which changes the foreign key relation of ABTest
to PageRevision
from models.CASCADE
to models.PROTECT
On creating the AB test, the following error happens:
wagtail-ab-testing.js?v=afb7bfd0:2 Uncaught ReferenceError: abTestingTabProps is not defined
at HTMLDocument.<anonymous> (wagtail-ab-testing.js?v=afb7bfd0:2:397058)
I'm running Wagtail 6.0.5, wagtail-ab-testing 0.10 on Python 5.0.7, Python 3.10
Edit: I just checked, and it seems the script is only needed for the actual edit page?
As the main script is also loaded on /cms/abtests/add/##/
it gives this error as no action menu is there.
I've noticed that wagtail-ab-testing is using about 60mb of memory locally and it scales up to about 150mb on some servers. For servers with lower memory, it'd be great to get this number down as much as possible.
If these are being queried often and there are a lot of tests, would we benefit from adding db_index=True
to these fields?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.