Git Product home page Git Product logo

wagtail-ab-testing's People

Contributors

brianxu20 avatar disconnect821 avatar jhonatan-lopes avatar kaedroho avatar kalobtaulien avatar mgax avatar nickmoreton avatar salty-ivy avatar stormheg avatar suxilog avatar tomusher avatar zerolab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wagtail-ab-testing's Issues

Add a simple developer documentation for new contributors

          @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.

Update create ab test screenshot

image

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.

Push a v0.4.1 or v0.5 to PyPI?

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)

conversions don't get tracked

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

TypeError: can_be_triggered_on_page_type() missing 1 required positional argument: 'page_type'

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:

https://github.com/torchbox/wagtail-ab-testing/blob/449a237292d401dea4a9dfe0ee49381cf5a049b4/wagtail_ab_testing/views.py#L135

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 🙏

Expected UI issues with Wagtail 3.0 release

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.

RemovedInWagtail60Warning: UserPagePermissionsProxy.for_page() is deprecated

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:

self.context['user_page_permissions'] = UserPagePermissionsProxy(self.request.user)

We should consider backwards compatibility with older versions of Wagtail when fixing this.

Support Wagtail 5.0's dark mode

The pages added by this package should display properly in dark mode.

This is what is looks like now:

image

It should have proper contrasting colors in dark mode.

JavaScript error on create AB test page

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.

Should we consider db indexing commonly queried fields? (memory optimization idea)

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.

https://github.com/torchbox/wagtail-ab-testing/blob/1ed69c764ed92e7495676ae34e1a5d6422977401/wagtail_ab_testing/models.py#L81

https://github.com/torchbox/wagtail-ab-testing/blob/1ed69c764ed92e7495676ae34e1a5d6422977401/wagtail_ab_testing/models.py#L77

If these are being queried often and there are a lot of tests, would we benefit from adding db_index=True to these fields?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.