You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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?
classProductDetailPage(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/$')defexternal_link_clicked(self, request, *args, **kwargs):
""" View function for tracking click to external link. """# Check if the user is trackableifrequest_is_trackable(request):
# Check if the page is the goal of any running teststests=AbTest.objects.filter(goal_event='external-link-click', goal_page=self, status=AbTest.STATUS_RUNNING)
fortestintests:
# Is the user a participant in this test?iff'wagtail-ab-testing_{test.id}_version'notinrequest.session:
continue# Has the user already completed the test?iff'wagtail-ab-testing_{test.id}_completed'inrequest.session:
continue# Log a conversiontest.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 🙏
The text was updated successfully, but these errors were encountered:
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: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?Any help would be very much appreciated! Thanks 🙏
The text was updated successfully, but these errors were encountered: