Skip to content

Commit

Permalink
Add dev and build scripts for thank you banners
Browse files Browse the repository at this point in the history
Make `campaign_info.toml` with fundraising banners the default again,
reverting the previous edit to the documentation.
Add `campaign_info.thank_you.toml`
Modify Webpack configuration to check for `env.campaign_info`
parameter, use `campaign_info.toml` as the default
Add two new `npm` scripts for running a special "thank you" dev
environment and building the thank you banners
Move file reading code to CampaignConfig class
Adapt README to document the thank you functionality
  • Loading branch information
gbirke authored and Abban committed Jan 9, 2024
1 parent 5077e36 commit 3c78e17
Show file tree
Hide file tree
Showing 9 changed files with 273 additions and 326 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ tracking pixels inside the banner.
1. Duplicate an existing folder with banner entry points, e.g. `banners/desktop`.
2. Create a new campaign and its banner configuration in `campaign_info.toml`.

## Developing and building "thank you" banners

The "thank you" banners have a special configuration file, `campaign_info.thank_you.toml`.
Edit this file for the necessary campaign and tracking parameters.

To use this file instead of the standard `campaign_info.toml` file, run `npm run thankyou` instead of `npm run dev`.
This environment does *not* use `nodemon` to watch for changes in `campaign_info.thank_you.toml`.
If you change that file or one of the webpack configuration files, you need to restart the server.

To build the "thank you" banners, run `npm run build:thankyou` instead of `npm run build`.

### Creating A/B tests

TODO: Rewrite this section for different types of tests (text changes,
Expand Down
171 changes: 171 additions & 0 deletions campaign_info.thank_you.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Example: "B18WMDE_"
# See https://github.com/wmde/fundraising-infrastructure/wiki/How-to-manage-banners-on-de.wikipedia.org


# Thank You Campaign
[thank_you]
name = "Desktop"
campaign = "C23_WMDE_Thank_You_DE_00"
icon = "desktop"
campaign_tracking = "ty01-240101"
description = "Thank you banner"
preview_link = "/wiki/Wikipedia:Hauptseite?devbanner={{banner}}&banner=B22_WMDE_local_prototype"
preview_url = 'https://de.wikipedia.org/wiki/Wikipedia:Hauptseite?banner={{PLACEHOLDER}}'
wrapper_template = "wikipedia_org"

[thank_you.banners.ctrl]
filename = "./banners/thank_you/banner_ctrl.de.ts"
pagename = "B23_WMDE_Thank_You_Desktop_DE_ctrl"
tracking = "org-ty-240101-ctrl"

[thank_you.banners.var]
filename = "./banners/thank_you/banner_var.de.ts"
pagename = "B23_WMDE_Thank_You_Desktop_DE_var"
tracking = "org-ty-240101-var"

[thank_you.test_matrix]
platform = ["edge", "ie11", "firefox_win10", "chrome_win10", "safari", "firefox_macos", "chrome_macos", "firefox_linux", "chrome_linux"]
resolution = ["800x600", "1024x768", "1280x960", "1600x1200", "1920x1200", "2560x1440"]


[thank_you_en]
name = "English Desktop"
campaign = "C23_WMDE_Thank_You_Desktop_EN_00"
icon = "desktop"
campaign_tracking = "ty01-240101"
description = "Thank you banner"
preview_link = "/wiki/Main_Page?devbanner={{banner}}&banner=B22_WMDE_local_prototype"
preview_url = 'https://en.wikipedia.org/wiki/Main_Page?banner={{PLACEHOLDER}}'
wrapper_template = "wikipedia_org"

[thank_you_en.banners.ctrl]
filename = "./banners/thank_you/banner_ctrl.en.ts"
pagename = "B23_WMDE_Thank_You_Desktop_EN_ctrl"
tracking = "org-ty-240101-en-ctrl"

[thank_you_en.banners.var]
filename = "./banners/thank_you/banner_var.en.ts"
pagename = "B23_WMDE_Thank_You_Desktop_EN_var"
tracking = "org-ty-240101-en-var"

[thank_you_en.test_matrix]
platform = ["edge", "ie11", "firefox_win10", "chrome_win10", "safari", "firefox_macos", "chrome_macos", "firefox_linux", "chrome_linux"]
resolution = ["800x600", "1024x768", "1280x960", "1600x1200", "1920x1200", "2560x1440"]

# Thank you campaign mobile wp.org
[thank_you_mobile]
name = "Mobile"
campaign = "C23_WMDE_Thank_You_Mobile_DE_00"
icon = "mobile"
campaign_tracking = "ty01-mob-240101"
description = "Thank you banner"
preview_link = "/mobile/wiki/Wikipedia:Hauptseite?devbanner={{banner}}&useskin=minerva&banner=B22_WMDE_local_prototype"
preview_url = 'https://de.m.wikipedia.org/wiki/Wikipedia:Hauptseite?banner={{PLACEHOLDER}}'
wrapper_template = "wikipedia_org"

[thank_you_mobile.banners.ctrl]
filename = "./banners/thank_you/banner_ctrl.de.ts"
pagename = "B23_WMDE_Thank_You_Mobile_DE_ctrl"
tracking = "org-mob-ty-240101-ctrl"

[thank_you_mobile.banners.var]
filename = "./banners/thank_you/banner_var.de.ts"
pagename = "B23_WMDE_Thank_You_Mobile_DE_var"
tracking = "org-mob-ty-240101-var"

[thank_you_mobile.test_matrix]
device = [ 'samsung_s10', 'iphone_xs_max', 'iphone_5s', 'iphone_se', "iphone_8", "iphone_12_mini", "iphone_7_plus", "iphone_11_pro_max"]
orientation = [ "portrait", "landscape"]

# English Thank you campaign mobile wp.org
[thank_you_mobile_en]
name = "English Mobile"
campaign = "C23_WMDE_Thank_You_Mobile_EN_00"
icon = "mobile"
campaign_tracking = "ty01-mob-en-240101"
description = "Thank you banner"
preview_link = "/en-mobile/wiki/Main_Page?devbanner={{banner}}&useskin=minerva&banner=B22_WMDE_local_prototype"
preview_url = 'https://en.m.wikipedia.org/wiki/Main_Page?banner={{PLACEHOLDER}}'
wrapper_template = "wikipedia_org"

[thank_you_mobile_en.banners.ctrl]
filename = "./banners/thank_you/banner_ctrl.en.ts"
pagename = "B23_WMDE_Thank_You_Mobile_EN_ctrl"
tracking = "org-mob-ty-240101-en-ctrl"

[thank_you_mobile_en.banners.var]
filename = "./banners/thank_you/banner_var.en.ts"
pagename = "B23_WMDE_Thank_You_Mobile_EN_var"
tracking = "org-mob-ty-240101-en-var"

[thank_you_mobile_en.test_matrix]
device = [ 'samsung_s10', 'iphone_xs_max', 'iphone_5s', 'iphone_se', "iphone_8", "iphone_12_mini", "iphone_7_plus", "iphone_11_pro_max"]
orientation = [ "portrait", "landscape"]

# Thank you campaign ipad wp.org
[thank_you_ipad]
name = "iPad"
campaign = "C23_WMDE_Thank_You_iPad_00"
icon = "pad"
campaign_tracking = "ty01-ipad-240101"
description = "Thank you banner"
preview_link = "/wiki/Wikipedia:Hauptseite?devbanner={{banner}}&banner=B22_WMDE_local_prototype"
preview_url = 'https://de.wikipedia.org/wiki/Wikipedia:Hauptseite?banner={{PLACEHOLDER}}'
wrapper_template = "wikipedia_org"

[thank_you_ipad.banners.ctrl]
filename = "./banners/thank_you/banner_ctrl.de.ts"
pagename = "B23_WMDE_Thank_You_iPad_ctrl"
tracking = "org-ipad-ty-240101-ctrl"

[thank_you_ipad.banners.var]
filename = "./banners/thank_you/banner_var.de.ts"
pagename = "B23_WMDE_Thank_You_iPad_var"
tracking = "org-ipad-ty-240101-var"

[thank_you_ipad.test_matrix]
device = [ 'ipad_mini', 'ipad', 'ipad_pro_9_7_inch', 'ipad_pro_12_inch' ]
orientation = [ "portrait", "landscape"]

# Thank you campaign wp.de
[thank_you_wpde]
campaign = "WPDE Desktop"
name = "C23_WPDE_Thank_You_Desktop_00"
icon = "desktop"
campaign_tracking = "ty01-wpde-240101"
description = "Thank you banner"
preview_link = "/wikipedia.de?devbanner={{banner}}&banner=dev-mode-wpde"
preview_url = 'https://www.wikipedia.de/?banner={{PLACEHOLDER}}'
wrapper_template = "wikipedia_de"
wrap_in_wikitext = false

[thank_you_wpde.banners.ctrl]
filename = "./banners/thank_you/banner_ctrl.wpde.ts"
pagename = "B23_WPDE_Thank_You_Desktop_ctrl"
tracking = "de-wpde-ty-240101-ctrl"

[thank_you_wpde.banners.var]
filename = "./banners/thank_you/banner_var.wpde.ts"
pagename = "B23_WPDE_Thank_You_Desktop_var"
tracking = "de-wpde-ty-240101-var"

[thank_you_wpde_mobile]
campaign = "WPDE Mobile"
name = "C23_WPDE_Thank_You_Mobile_00"
icon = "mobile"
campaign_tracking = "ty01-wpde-mob-240101"
description = "Thank you banner"
preview_link = "/wikipedia.de?devbanner={{banner}}&banner=dev-mode-wpde"
preview_url = 'https://www.wikipedia.de/?banner={{PLACEHOLDER}}'
wrapper_template = "wikipedia_de"
wrap_in_wikitext = false

[thank_you_wpde_mobile.banners.ctrl]
filename = "./banners/thank_you/banner_ctrl.wpde.ts"
pagename = "B23_WPDE_Thank_You_Mobile_ctrl"
tracking = "de-wpde-mob-ty-240101-ctrl"

[thank_you_wpde_mobile.banners.var]
filename = "./banners/thank_you/banner_var.wpde.ts"
pagename = "B23_WPDE_Thank_You_Mobile_var"
tracking = "de-wpde-mob-ty-240101-var"
Loading

0 comments on commit 3c78e17

Please sign in to comment.