One URL to Rule Them All: Dynamic Landing Pages in Wagtail with Chrissy Wainwright

This video features Chrissy Wainwright at DjangoCon US 2026 in Chicago, Illinois, USA.

One URL to Rule Them All: Dynamic Landing Pages in Wagtail with Chrissy Wainwright
0:19:46
Published October 26, 2026
63 views

Every marketing campaign has the same problem: one message, a dozen audiences, and suddenly your CMS is drowning in nearly identical pages. For Truth Initiative, the nation’s largest nonprofit dedicated to ending nicotine addiction, editors were maintaining a growing library of duplicate landing pages with no clean way to test what was actually working.

We solved it with a dynamic Wagtail landing page, built on a Django backend, that tracks users based on the last URL segment (e.g., /youtube, /facebook). A/B testing was baked in at the CMS level to help test different features against a percentage of the audience. Editors now manage a single page design for tailoring text, CTAs, and creative assets.

This session covers:

The business problem of campaign duplication.
How we used Django and Wagtail to manage user tracking using a single landing page
How A/B testing was implemented for testing different text within the page
The impact: reduced editor workload, faster rollouts, and consistent design across channels.

Attendees will walk away with a scalable, editor-friendly model for tackling personalization without drowning in duplicate content.

This talk was presented by Chrissy Wainwright at DjangoCon US 2026 in Chicago, Illinois, USA
https://2026.djangocon.us/talks/one-url-to-rule-them-all-dynamic-landing-pages-in-wagtail/

LINKS:
Follow Chrissy Wainwright 👇
Website: https://sixfeetup.com/

Transcript

3,209 words · auto-generated · en Show

Automatically transcribed, so expect mistakes in names and technical terms.

0:15

Speaker 1: Alright, hello. I am going to talk about dynamic landing weight landing pages in Wagtail. So this is based on a project where I worked Where we're six feet up, did some staff AUG for Truth Initiative. And in this project, I helped set up campaign pages in their website in a way to make life easier for the marketing team and the content editors. So I am Chrissy Wainwright. I am a senior software engineer at Six Feet Up. I've been there for over 18 years now, doing front-end development, back-end development. Nowadays, I actually do a lot more quality assurance than anything. I am a former Plone Foundation president for any other Plonistas in the room. Also, I'm an adventure seeker and a collector of hobbies. Also, Eric Sherman is here from Truth Initiative.

1:02

Speaker 1: He was sitting right over there a moment ago. He's around here. He's been helping to organize this conference, and I worked with him on this project. And then he helped provide some updates because like our contract ended last year. And so he's been taking over like some of the work that I did. um since that time. So he'll also, there he is. He'll also be here to help and answer any questions about the project. So, to give you some more context on who Truth Initiative is , they are a nonprofit organization that has helped millions of people quit smoking. The site that we worked on was xprogram. com, that is exprogram. com, and that allows people to sign up for the program

1:49

Speaker 1: that has actionable steps to help them quit all forms of nicotine. Because of their benefit to humankind and the lasting effects, the work that we at Six Feet Up did with Truth makes it one of our impactful projects. We have a goal of working on 100 impactful projects by 2033, and you can visit sixfeetup. com slash impactful to learn more. Now let's talk about what campaign pages are and the problem that we work to solve. Campaign pages are the entry point for marketing campaigns for Truth initiative with the goal of getting people to register for the program to quit smoking. The ad campaigns running across various platforms, each linked to their own URL, to help track where users are coming from. So there may be ad campaigns running on TikTok or Reddit, and each one will would go to join.

2:39

Speaker 1: xprogram. com slash TikTok slash Reddit, or there might be other campaigns with a general name like slash awareness. Now they had a problem with their old setup. Each new campaign got its own landing page, which would mostly be a duplicate of the original. You can see from these screenshots that there would be a few variations, there would be slight differences between them, but it was important for Truth to know which campaigns were attracting more signups for the program. Now this all became a problem for the site editors when the site grew to have dozens of these duplicated pages. I think I counted maybe somewhere between 50 and 60 that all needed to be updated to keep them all consistent. So each path was a separate page.

3:25

Speaker 1: These lived in a CMS that was not Django-based, and Truth wanted to integrate them into their Wagtail code base and site. Adding a new marketing campaign required three to four people doing tasks. A new campaign or tag meant a new page on the site, a new keyword for SMS entry, new tracking setup, and it was a lot of work to add a new campaign. So the challenge we faced was how can we support many possible URLs serving the same experience with reliable tracking for marketers and a low effort for the editors? Our solution in Wagtail was to use a routable page mix-in along with a campaign page model. The campaign page model is a typical model with fields defined for the

4:13

Speaker 1: dynamic content. The magic is in the routable page mix-in. A routable page mixin, if you're not familiar, it is it allows you to define various paths that can be used against the same content object instead of creating views and defining paths in the URLs. py. Everything is managed within the model and it can be dynamic. So here are some simplified examples from the Wagtail docs showing that different functions can be used for the different paths. Let's say we have an event listing page at mysite. com slash events. So the first function here, current events. The path decorator that's shown at the top is just blank. This means like When they come to slash events, this is what they're going to see. This function will run against that code.

5:00

Speaker 1: So we can put in some custom code in there to only return the current events. The next one there, the at path decorator, is taking the path past. So that would be mysite. com slash events slash past. And it will run the past events function where we can sp you know tell it to only return past events. Going further, Multiple paths can be used for a single function. So this first function will handle slash events slash current or slash events slash 2024. or any other year. Notice the variable being defined for the year, which needs to be an integer. At least that's what we're defining here. And then that is Passed in as

5:47

Speaker 1: a parameter for the year, which then can be used in the function. So if the user goes to slash 2024 , That year is then put into the function so we can make sure to only return the events in 2024. Also, regex can be used for matching paths. You can see the decorator on that last one is slightly different. It has the reunder path instead of just at path. So those are some basic examples. Now let me show you what we set up in the site. Actually, let's install it first. I'll show you those steps. So add wagtail. contrib. routable under page to the installed apps. And then our custom campaign page model will inherit from routable page mix-in. It also needs to inherit from Wagtail's page model, and the ordering

6:35

Speaker 1: is important. Uh any mixins need to be before the actual like model that it's subclassing. Now here we included the at path decorators on the serve function. And this is part of the campaign page model. It's all like in that same code. Now, while the examples earlier defined different functions depending on the URL, we only needed a single function that handled any path We did not need to display different content per campaign. We just needed to know where users were coming from and do it with a URL structure that matched what was already existing on the old site. So we have two path decorate definitions here, one for the root URL of the page, and then a catch-all for anything that was appended onto that URL, because we assumed that anything after that was going to be the name of the campaign.

7:28

Speaker 1: So any additional path in the URL gets saved as the variable campaign slug, which we made sure to include in the object's context, which then gets passed onto the template Notice we aren't doing defining any specific campaigns here. It's left open-ended so that as new campaigns were added, they don't have to be managed here. Wagtail is just taking that information and passing it along. So if you are doing something similar in your site, you know how you use that campaign slug to track users will vary depending on your setup. Truth's main goal was to track how many people fill out the form to join the program. So we put the value of the campaign slug as a hidden input on that form. And use that on the back end with the form submission for attaching it to the appropriate campaign.

8:13

Speaker 1: So you can see in the top example here in the Django template we have the campaign slug, but on the front end when users view it in the site, it's going to actually change that to whatever campaign they were coming from. So after getting that all set up and working, Truth ran into some issues when they wanted to add sub-campaigns nested under the main campaign page, along with some other generic subpages that contain some additional information. The generic page would throw an attribute error, specifically. It was object has no attribute render. So if we look back at the code on here. So this is that function again. Now remember we had that catch all to pick up any campaign slug? Well you can see the self dot render and the return is what the error referenced.

9:01

Speaker 1: This happened because that catch all path was picked up by this function, even though this function is for campaign pages, not generic pages like what we needed the website to serve. By this point, I was no longer working on the project. Eric had taken over and was working on the fix. He had tried a couple different ways to handle this. One was to wrap the return in a try accept to catch that attribute error, but that didn't quite fix all the use cases. He also added a check to see like what model the current object used. But ultimately he decided to add a custom route function. Now this works in conjunction with the serve function so that if a page with the given path already exists, that is the object the user is going to see. Otherwise, they'll see the root campaign page

9:47

Speaker 1: and the given path is assumed to then be the campaign slug like originally intended. So I also mentioned they wanted to create sub-campaigns. Having these nested sub-campaigns meant that a custom campaign could be created for a particular event and be branded to match that event. So these images show actual examples from the Celebration Bowl in Atlanta last year. Various campaign slugs were used to help determine if the user came from online advertising for the event or from digital billboards that were physically at the stadium. In this case, it did make sense to create a duplicate of that campaign page since it was a short-lived campaign. They weren't going to have to manage this, manage multiples again in the future.

10:34

Speaker 1: So the other part of this project that I did was to work with these campaign pages and implement A-B testing. A -B testing is a process of presenting different users, one or two versions of a page, one of two versions of a page, to see which option is going to be more attractive to users. Examples would be having different description text. So highlighted here is slightly different between the two versions, or a different call-to-action text. on the button. And this can be done in Wagtail using an add-on called A-B testing, and I'll show you how to set it up. I'll go through some of this kind of quickly because the instructions are in the docs for A-B testing, but you'll add the Wagtail A-B testing to the list of installed apps.

11:24

Speaker 1: You'll add a line to the URLs. py because there's a new path that's going to be available. And then include a couple lines into the base HTML to import the tags and load the script. Uh but we ran into trouble with this part because the templates on the Truth Initiative's website are using Jinja instead of Django's default templating engine. So we had to implement a workaround by adding the script to the global variables in Jinja. py. And this this is not in the docs, so this was just something that I had to figure out how to make it work. And then we could add the script in pieces into the base HTML. So this skips the template tag from A-B testing, but it accomplishes the same thing in the end because really we just needed the script to be loaded.

12:13

Speaker 1: A B testing does work by tracking users, but not in a way that you need to worry about privacy issues. It uses local storage in the user's browser. So as long as the user only uses that browser. That's kind of how the tracking works. So it uses the local storage in the browser. It always shows the same version of a page to that user. And it will not count multiple visits or multiple conversions for that user. Now, the purpose of A-B testing is to figure out what elements or text on the page might encourage users to engage more. The specific metric that Truth wanted to measure was how many visitors fill out the form to sign up for the program. There is a solid example of how to set up this type of conversion in the A-B testing docs.

13:03

Speaker 1: So here is the version that we put in. The Wagtailhooks. py registers the goal for our campaign page, and the event handler is called by JavaScript on the page when the user clicks the submit form. And this is just a jQuery listener that's like listening for that click click event on that button. All right, so now I have a demo to show what this add-on looks like from the admin's perspective. I've got a vanilla wagtail setup site set up with a simple custom page model that's using the routable page mix-in and A-B testing installed and set up on that. So I added a custom page into the site

13:49

Speaker 1: and I'm going to edit it. I'm going to make a couple little changes so that it's easy to see which version is the control and which is the variant. And now when I save it, instead of saving save as draft or publishing, there is the option to save and create a b test. Now this will bring up an intermediary page that shows us the difference between the control and the variant. And I can click to create the test. And that will bring up another form that gives me options to add a name for it, a hypothesis. I can choose a goal, and that will be the goal that we had created. I 'll select that submit form. I can add a sample size. We'll just say 50 users on this one.

14:34

Speaker 1: And now we can actually start the test. Now instead of editing the page or seeing the view, we get an activity log. And this is the page we can come back to regularly regularly to see how our A-B test is going. Now I'll open up a few browsers and we'll see what we get. So here on this one we're seeing the control and if I refresh a few times you can see I'm still getting that control version. Now I'll try in a couple more browsers. This one you can see the variants showing up. And if I refresh a couple times, you can see that variant is still what's displaying. So we'll go ahead and do a couple more browsers just to make sure we have some more sample users. And like I said, this uses local storage in the browser, so it's going to be different for each browser.

15:26

Speaker 1: And there's another one with a control. And now if I go back to the activity log and refresh, you can see that There are two users that saw the control, two users that saw the variant. And now I can go back to a couple of those browsers and we'll uh trigger some conversions. I'll hit the submit button. So if we go refresh, you can see uh the control users have a hundred percent conversion rate because both of those users um actually submitted the form and none of the variant users did. So that is what A B testing add-on looks like.

16:14

Speaker 1: All right, thank you. Uh do we have any questions?

16:27

Speaker 2: Could you reiterate what was the reasoning behind um having sub-campaigns versus just having a separate campaign?

16:36

Speaker 1: I'm gonna defer to Eric on that.

16:47

Speaker 3: We've got so many microphones. Sorry, what was the question again? Basically like why Why there were subcampaigns. I mean th the very short answer is because our product and marketing team wanted the ability to do that. So we did. Um I I think it can help from an organizational perspective, like in the case of the celebration bowl. Um we might have had a sort of that represented a sub-campaign and then we would have nested campaign pages inside of that for the different sources. You know, if you're using like uh Google UTM parameters, that might be like a billboard versus a poster, but that's not how our marketing team was tracking these. Um so that was an advantage. And then One of the things that's maybe like

17:32

Speaker 3: it's almost uh it's kind of complicated, but is also pretty simple is because they're each Wagtail pages, you still have the ability to add a page there and then customize the content, but then if you don't add a page in that path, it will still get served and tracked. So it just kind of helped to reduce the number of steps to manage that. Is that gonna answer your question?

17:54

Speaker 1: Thumbs up all around.

17:59

Speaker 4: Do you have any guidance for how to apply A-B testing such as this in the context of a paywall or registration wall?

18:12

Speaker 1: Are you saying if to determine like if users want to sign up for something? Or I mean I think I would believe it could be done the same way. It would be the land the whatever page you have set up. Um yeah, it would be connected so that Users would land, they would see one either the control or the variant, and then if they signed up, then that would be your conversion.

18:41

Speaker 4: Do you have any uh I guess follow-up uh guidance with regard to sample sizes for these efforts?

18:50

Speaker 1: I don't, I did not play around with that at all. I was li I left that up to the marketing team to to figure out what they wanted, how they wanted that to work. But essentially the um The A-B test would run until it had gotten 50 sample users, and then it would stop, and so automatically everyone would see the control again.

19:10

Speaker 4: Okay.

19:10

Speaker 3: Yeah, I can I can add to that too if you if you take a look at the Wagtail A B testing library, they also they link to some guidelines for like statistically kind of how to figure out those numbers. But Kinda like Calvin said in the other number, part of it's gonna be uh it depends on what you're trying to measure.

19:27

Speaker 4: That's fair. Thank you.

19:29

Speaker 1: Okay, well I'll be around. I'll be at our booth or let me know if you have any other questions or hit up Eric too. Thank you Rigas?

Conference

DjangoCon US

August 24 - 28, 2026

Chicago, Illinois, USA

Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.

More videos from DjangoCon US