Skip to content

feat: hero photo A/B test, Resources nav, Donate button and supporting-member donation options - #640

Merged
mohanadft merged 13 commits into
mainfrom
feat/home-hero-photo-test
Dec 1, 2026
Merged

mohanadft merged 13 commits into
mainfrom
feat/home-hero-photo-test

Conversation

@mohanadft

@mohanadft mohanadft commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Everything to ship before the test starts, in one PR (#639 folded in):

  1. Hero copy font size: "These projects include…" now matches the paragraph above it (19px, 21px from 810px; was 17/18px).
  2. Nav: Resources menu with Updates, Tools, Hiring Palestinians and Media. Tools moves out of Projects, Media out of About, and the top-level Updates link becomes Resources › Updates. The Resources label opens /tools. The footer follows the same structure.
  3. "Project Opportunities" renamed "Adopt a Project" (nav and footer).
  4. Donate button right of "Become a Member" (below it in the mobile menu), linking to /supporting-member. Nav items sit a little closer until 2xl so all three buttons fit at 1280px.
  5. /supporting-member: the /donate page's "Other ways to give" card now sits beside the payment form (below it on narrow screens), as one shared component used by both pages. Under "Step 2 of 2: Payment" there's a new "I want to make a one-time donation" link to /donate. /membership is unchanged.
  6. Nav label A/B test removed. "Member Opportunities" (→ /volunteer) won and is hard-coded. The nav no longer calls GrowthBook or sends Nav Label Shown/Nav Label Click, and Membership-complete no longer carries experiment props. The daily visitor-id helper stays for the hero test, as src/lib/visitorAssignment.ts. After this deploys, archive the nav-get-involved-label flag in GrowthBook.
  7. The hero photo A/B test, described below.

Open question for the team: the "Updates" label under Resources may be renamed "Blog" or "Publications".

Hero photo A/B test

Cookieless A/B test of four homepage hero photos: the current photo (control) against three photos of T4P members at events (speaker, laptops, stage). Results are read in Plausible.

Design: docs/superpowers/specs/2026-11-25-homepage-hero-photo-ab-test-design.md · Plan: docs/superpowers/plans/2026-11-25-homepage-hero-photo-ab-test.md

How it works

  • src/pages/index.astro evaluates the GrowthBook flag homepage-hero-photo during SSR with the existing daily cookieless visitor id (requestAssignmentId: HMAC of UTC date, IP and User-Agent), so a visitor keeps one photo all day and nothing is stored on their device. Only the assigned photo is downloaded.
  • A visitor counts as assigned only when GrowthBook returns source: "experiment". Flag off, flag missing, CDN down or an error all show control and send no experiment data.
  • Assigned visitors' homepage events carry hero_photo via plausible.init({ customProperties }), read from a new analyticsProps prop on Layout.astro. Bounce rate, scroll depth and time on page can then be filtered per photo.
  • Homepage Link Click (prop destination) records clicks to /membership, /volunteer, /projects and /incubator from anywhere on the homepage, including the nav, footer and mobile menu.

⚠️ Site-wide analytics change: bounce rate will rise from this deploy
Plausible counts every custom event as an interaction, so events fired without the visitor doing anything have been stopping visits from counting as bounces. The homepage showed a 3% bounce rate because of this. These events are now sent with interactive: false: Newsletter Popup Shown, Challenge Popup Shown, Report Popup Shown, and Donate Form on /donate and /donate-2. Bounce rates across the site, /donate included, will rise from the deploy date and won't be comparable with earlier periods.

Photos: 1600px and 800px WebP files in public/images/hero/, sized in line with the current photo (~129 KB at 1600px) so no variant loads slower. The people pictured have agreed to appear on the homepage.

Before switching the flag on

  • Flag homepage-hero-photo created in GrowthBook (string, default control), off in all environments
  • Experiment rule added and published (experiment "Homepage hero photo", running; tracking key homepage-hero-photo, hash on id, 4 × 25%, 100% coverage). Flag still off in every environment
  • Credits for the three new photos: © Tech for Palestine
  • Preview deploy with the flag on: check each photo's crop on desktop and at ~390px; the /api/pipe pageview carries hero_photo; Plausible engagement events carry it too (if not, use the fallback in the spec); a prerendered / sends its pageview only when shown; clicks send Homepage Link Click
  • Plausible: add goal Homepage Link Click and custom property hero_photo
  • Turn the flag on in production and run for 14 full days

Checklist

  • Env vars are read through getEnv(name, locals); no secrets in source or client code
  • No style="" attributes and no 'unsafe-inline' added to the CSP
  • Secrets are compared with constantTimeEqual, not ===
  • Public POST endpoints check Origin before parsing the body and validate input
  • Removed or renamed pages have a 301 in public/_redirects
  • New experimental or orphan pages are in the sitemap filter exclude list
  • No new -new pages
  • pnpm lint, pnpm check and pnpm test pass (704 tests), plus pnpm build

…te is real

Plausible counts every custom event as an interaction unless interactive is false, so popup/nav "Shown" and "Donate Form" events fired on load were stopping visits from counting as bounces. Site-wide bounce rates, including /donate, will rise from this deploy.
- cache-control comment: note the hero photo A/B test also needs / out of shared caches
- heroPhotoExperiment test: fake closest() only matches the a[href] selector
- re-encode speaker hero WebPs at quality 70 (129 KB / 50 KB) to match control weight
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 63047d4
Status: ✅  Deploy successful!
Preview URL: https://9b7b5a3a.website-aun.pages.dev
Branch Preview URL: https://feat-home-hero-photo-test.website-aun.pages.dev

View logs

Replaces the three TODO credit placeholders and fails the test if a placeholder credit returns.
Resources (opens /tools) holds Updates, Tools, Hiring Palestinians and Media; Tools moves out of Projects, Media out of About, and the top-level Updates link becomes part of Resources. 'Project Opportunities' is now 'Adopt a Project'. A Donate button to /supporting-member sits right of 'Become a Member' on desktop and below it in the mobile menu.
…ation link

The /donate page's 'Other ways to give' card is now a shared component, shown beside the payment form on /supporting-member (below it on narrow screens). Its new-tab links gain rel=noopener noreferrer. JoinFlow takes an optional oneTimeDonationHref; /supporting-member sets it to /donate, so 'I want to make a one-time donation' appears under the Step 2 of 2: Payment header. /membership is unchanged.
…ons at 1280px

Footer: 'Adopt a Project', Tools and Media move to a new Resources group (with Updates and Hiring Palestinians), five columns on large screens. Desktop nav items sit 1.5rem apart until 2xl so Hub, Become a Member and Donate fit at 1280px.
@mohanadft mohanadft changed the title feat(home): A/B test four hero photos with GrowthBook, measured in Plausible feat: hero photo A/B test, Resources nav, Donate button and supporting-member donation options Nov 25, 2026
@mohanadft
mohanadft changed the base branch from fix/home-hero-copy-size to main November 25, 2026 10:59
'Member Opportunities' (/volunteer) won and is now hard-coded. The nav no longer asks GrowthBook for a variant, sends Nav Label Shown/Click, or adds experiment props to Membership-complete. The daily visitor-id helper stays for the hero photo test, renamed src/lib/navAssignment.ts -> src/lib/visitorAssignment.ts; its env var keeps the NAV_ASSIGNMENT_SECRET name already set in Cloudflare.
Speaker, laptops and stage are now 1:1 crops (1600 and 800 WebP, sized within ~6% of the control photo so no arm loads slower) and centred. Laptops now shows two people and stage only the Tech for Palestine banner, so their alt text follows.
@mohanadft
mohanadft merged commit 5d0c48d into main Dec 1, 2026
5 checks passed
@mohanadft
mohanadft deleted the feat/home-hero-photo-test branch December 1, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant