Extension:GrowthExperiments/Technical documentation/Campaigns/Creation of customized landing pages
The GrowthExperiments extension allows the creation of customized signup (Special:CreateAccount) pages for campaigns (organized editing events such as editathons). Campaign organizers can include a campaign
query parameter in their URLs, and the campaign configuration defines how the signup experience should be modified. The user account created using such an URL parameter will be permanently associated with that campaign (by storing the campaign name in the growthexperiments-campaign
user preference), resulting in some permanent small changes in the behavior of Special:Homepage (or at least permanent until the configuration for that campaign is removed).
The campaign configuration is defined by the configuration variables $wgGECampaigns
and $wgGECampaignTopics
, both of which can also be set via community configuration, as the GECampaigns
and GECampaignTopics
fileds of the wiki page MediaWiki:GrowthExperimentsConfig.json
(or whatever page is specified by $wgGEWikiConfigPageTitle
).
Unlike most other MediaWiki:GrowthExperimentsConfig.json
settings, editing the campaign configuration via Special:EditGrowthConfig is not supported; the page needs to be edited manually. (The edit tab links to the special page but edit URLs work as usual.)
$wgGECampaigns
edit
$wgGECampaigns
is the main campaign configuration, an associative array with one entry per campaign. The entry key is the campaign ID (in the source code also referred to as "campaign term"), which will be used internally for identifying the campaign in analytics. (Note this is NOT the same as the campaign
URL parameter, which in the source code is referred to as "campaign name"; the campaign pattern is used to map between the two.) A campaign entry is itself an associative array, which can have the following values:
Parameter | Required? | Documentation |
---|---|---|
pattern
|
yes | The campaign pattern. A PHP regular expressions that the campaign URL parameter will be matched against. The first entry (in the configuration array's natural order) with a matching regexp will be the campaign that gets associated with the registration.
|
topics
|
no | Extra campaign topics to be used in the suggested edits module's topic selector on Special:Homepage. This is an experimental feature and not enabled for normal campaigns. The value is a list of topic IDs; the IDs should match $wgGECampaignTopics .
|
skipWelcomeSurvey
|
no | When set to true, the welcome survey won't be shown to the user at the end of signup (they go straight to Special:Homepage instead). |
qualityGateIdsToSkip
|
no | The list of task type IDs (field names from MediaWiki:NewcomerTasks.json ) for which the quality gate configuration should be ignored. (Quality gates are limits on GrowthExperiments suggested edits activity, such as a daily limit on suggested edits per user.) Currently only works for the image-recommendation task type ID.
|
signupPageTemplate
|
no | Determines the signup page type. When missing, the normal signup page is used. Currently supports two types:
|
signupPageTemplateParameters
|
no | Parameters to the template, as an associative array. Currently supported:
|
$wgGECampaignTopics
edit
An associative array of topic ID => CirrusSearch query. This is experimental and presently not very useful as the existing CirrusSearch queries aren't very good for topic selection. It has been used with hand-crafted, one-off CirrusSearch keywords for some select campaigns.
Messages
editThe following system messages are used on the custom landing page:
growthexperiments-<messageKey>-title
/growthexperiments-<messageKey>-title-mobile
growthexperiments-<messageKey>-body
/growthexperiments-<messageKey>-body-mobile
growthexperiments-<messageKey>-bullet1
growthexperiments-<messageKey>-bullet2
growthexperiments-<messageKey>-bullet3
The title and body can be hidden by setting them to -
.
When messageKey
is not set in signupPageTemplateParameters
, it defaults to signupcampaign
, which results in a generic welcome page focusing on GrowthExperiments features.
Classes
editHTML classes which can be used for styling:
mw-ge-donorsignup-block
,mw-ge-donorsignup-block-<messageKey>
- wrap the customizable part of the signup pagemw-ge-donorsignup-title
mw-ge-donorsignup-body
mw-ge-donorsignup-list
(on the bullet list)
URL parameters
editThere are a number of URL parameters that can be used to modify the signup experience. Most of these aren't technically related to campaigns but usually used for that purpose.
Parameter | Documentation |
---|---|
campaign
|
The campaign name (see above). |
geEnabled
|
Whether GrowthExperiments features (the user preference settings "Display newcomer homepage", "Default to newcomer homepage from username link in personal tools", "Enable the editor help panel") should be enabled by default. |
geForceVariant
|
Force the user into a specific A/B testing variant (see VariantHooks::VARIANTS ).
|
forceMentor
|
Pipe-delimited list of usernames (who must be mentors); the new user's mentor will be selected from these users. |
Examples
editA very basic campaign configuration:
{
"2023-signup": {
"pattern": "/^2023-signup$/",
"signupPageTemplate": "hero"
}
}