Pricing flow: model picker first, then model-specific price ranges
deploy / build-and-publish (push) Successful in 40s
deploy / build-and-publish (push) Successful in 40s
- Q0 'Which pricing model would you prefer?' (monthly / annual / per
project radios) gates the four PSM questions; picking a model reveals
question 1 and swaps each question's ranges to that model's set
(switching model clears previous answers)
- ranges: monthly and per-project unchanged (€0/10/25/50/100+); annual
€0/50/150/300/500 (tops at €500 per Keith's gut - to be tested)
- questions reworded model-neutral ('At what price...' instead of
'monthly price')
- analytics: price-model-<model> for the picker, price-<model>-<question>-<option>
per answer; Zoho payload gains price_model plus the usual question=option
pairs
- CMS config: price_models list (key/label/options) + price_model_question;
price_groups simplified to key/heading; preview mirrors the flow
This commit is contained in:
1 parent
f3bdd925d5
commit
7bac903809
5 files changed
+137
-96
No files matched your search
@@ -131,6 +131,9 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
// not the checkbox's literal "on"; an unchecked box never arrives)
|
||||
payload.consent = data.get("consent") === "on";
|
||||
if (payload.website) return; // honeypot: pretend success, send nothing
|
||||
// the pricing-model picker lives outside the <form> element
|
||||
const modelPick = document.querySelector('input[name="price_model"]:checked');
|
||||
if (modelPick) payload.price_model = modelPick.value;
|
||||
button.disabled = true;
|
||||
button.textContent = STRINGS.sending || "Sending…";
|
||||
try {
|
||||
|
||||
+71
-31
@@ -273,29 +273,46 @@ const hasForm = isAudiencePage;
|
||||
|
||||
<slot />
|
||||
{
|
||||
Array.isArray(fm.price_models) && fm.price_models.length > 0 &&
|
||||
Array.isArray(fm.price_groups) && fm.price_groups.length > 0 && (
|
||||
<section class="pricing">
|
||||
<h2>{fm.price_title}</h2>
|
||||
{fm.price_note && <p class="pricing-note">{fm.price_note}</p>}
|
||||
{fm.price_groups.map((g, i) => (
|
||||
<fieldset class="price-group" hidden={i > 0}>
|
||||
<fieldset class="price-group model-picker">
|
||||
<legend>{fm.price_model_question}</legend>
|
||||
<div class="cards price-list">
|
||||
{fm.price_models.map((m) => (
|
||||
<label class="card cap">
|
||||
<input type="radio" name="price_model" value={m.key} data-model-pick={m.key} />
|
||||
<span class="cap-body">
|
||||
<strong>{m.label}</strong>
|
||||
</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
{fm.price_groups.map((g) => (
|
||||
<fieldset class="price-group" hidden>
|
||||
<legend>{g.heading}</legend>
|
||||
<div class="cards price-list">
|
||||
{g.options.map((o) => (
|
||||
<label class="card cap" data-umami-event={`price-${g.key}-${o.key}`}>
|
||||
<input
|
||||
type="radio"
|
||||
name={`price-${g.key}`}
|
||||
data-price={o.key}
|
||||
data-price-group={g.key}
|
||||
data-price-label={o.label}
|
||||
/>
|
||||
<span class="cap-body">
|
||||
<strong>{o.label}</strong>
|
||||
</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
{fm.price_models.map((m) => (
|
||||
<div class="cards price-list model-set" data-model-set={m.key}>
|
||||
{m.options.map((o) => (
|
||||
<label class="card cap price-opt" data-model={m.key}>
|
||||
<input
|
||||
type="radio"
|
||||
name={`price-${g.key}`}
|
||||
data-price={o.key}
|
||||
data-price-group={g.key}
|
||||
data-price-model={m.key}
|
||||
data-price-label={o.label}
|
||||
/>
|
||||
<span class="cap-body">
|
||||
<strong>{o.label}</strong>
|
||||
</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</fieldset>
|
||||
))}
|
||||
</section>
|
||||
@@ -358,19 +375,40 @@ const hasForm = isAudiencePage;
|
||||
window.umami && window.umami.track(el.dataset.umamiEvent, { selected: !!el.checked });
|
||||
} catch {}
|
||||
});
|
||||
// Progressive price questions: answering one reveals the next
|
||||
// (fieldsets after the first ship hidden; radios answer each).
|
||||
document.addEventListener("change", (event) => {
|
||||
const el = event.target;
|
||||
if (!el || !el.matches || !el.matches("[data-price]")) return;
|
||||
const group = el.closest("fieldset.price-group");
|
||||
if (!group) return;
|
||||
const next = group.nextElementSibling;
|
||||
if (next && next.matches("fieldset.price-group")) {
|
||||
next.hidden = false;
|
||||
try { next.scrollIntoView({ behavior: "smooth", block: "nearest" }); } catch {}
|
||||
}
|
||||
});
|
||||
// Pricing flow: pick a model first, then the four questions appear
|
||||
// one at a time, each showing only the selected model's price
|
||||
// ranges. Switching model clears previous answers.
|
||||
const pricing = document.querySelector("section.pricing");
|
||||
if (pricing) {
|
||||
const sets = pricing.querySelectorAll(".model-set");
|
||||
const groups = [...pricing.querySelectorAll("fieldset.price-group:not(.model-picker)")];
|
||||
pricing.addEventListener("change", (event) => {
|
||||
const el = event.target;
|
||||
if (!el || !el.matches) return;
|
||||
if (el.matches("[data-model-pick]")) {
|
||||
const model = el.dataset.modelPick;
|
||||
sets.forEach((s) => s.classList.toggle("active", s.dataset.modelSet === model));
|
||||
pricing.querySelectorAll("[data-price]").forEach((r) => { r.checked = false; });
|
||||
groups.forEach((g) => { g.hidden = true; });
|
||||
if (groups[0]) {
|
||||
groups[0].hidden = false;
|
||||
try { groups[0].scrollIntoView({ behavior: "smooth", block: "nearest" }); } catch {}
|
||||
}
|
||||
try { window.umami && window.umami.track("price-model-" + model); } catch {}
|
||||
} else if (el.matches("[data-price]")) {
|
||||
try {
|
||||
window.umami &&
|
||||
window.umami.track(`price-${el.dataset.priceModel}-${el.dataset.priceGroup}-${el.dataset.price}`);
|
||||
} catch {}
|
||||
const group = el.closest("fieldset.price-group");
|
||||
const next = group && group.nextElementSibling;
|
||||
if (next && next.matches("fieldset.price-group")) {
|
||||
next.hidden = false;
|
||||
try { next.scrollIntoView({ behavior: "smooth", block: "nearest" }); } catch {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
@@ -526,6 +564,8 @@ const hasForm = isAudiencePage;
|
||||
.price-list { grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); }
|
||||
fieldset.price-group { border: 0; margin: 1.4rem 0 0; padding: 0; }
|
||||
fieldset.price-group[hidden] { display: none; }
|
||||
.price-group .model-set { display: none; }
|
||||
.price-group .model-set.active { display: grid; }
|
||||
fieldset.price-group legend {
|
||||
font-weight: 600;
|
||||
font-size: 1rem;
|
||||
|
||||
+31
-53
@@ -25,61 +25,39 @@ value_props_title: What you get
|
||||
journey: []
|
||||
journey_title: ''
|
||||
journey_note: ''
|
||||
price_model_question: Which pricing model would you prefer?
|
||||
price_models:
|
||||
- key: monthly
|
||||
label: Monthly subscription
|
||||
options:
|
||||
- { key: eur0, label: "€0" }
|
||||
- { key: eur10, label: "€10" }
|
||||
- { key: eur25, label: "€25" }
|
||||
- { key: eur50, label: "€50" }
|
||||
- { key: eur100plus, label: "€100+" }
|
||||
- key: annual
|
||||
label: Annual
|
||||
options:
|
||||
- { key: eur0, label: "€0" }
|
||||
- { key: eur50, label: "€50" }
|
||||
- { key: eur150, label: "€150" }
|
||||
- { key: eur300, label: "€300" }
|
||||
- { key: eur500, label: "€500" }
|
||||
- key: per_project
|
||||
label: Per project
|
||||
options:
|
||||
- { key: eur0, label: "€0" }
|
||||
- { key: eur10, label: "€10" }
|
||||
- { key: eur25, label: "€25" }
|
||||
- { key: eur50, label: "€50" }
|
||||
- { key: eur100plus, label: "€100+" }
|
||||
price_groups:
|
||||
- key: too_expensive
|
||||
heading: At what monthly price would the journey feel too expensive?
|
||||
options:
|
||||
- key: eur0
|
||||
label: €0
|
||||
- key: eur10
|
||||
label: €10
|
||||
- key: eur25
|
||||
label: €25
|
||||
- key: eur50
|
||||
label: €50
|
||||
- key: eur100plus
|
||||
label: €100+
|
||||
- key: bargain
|
||||
heading: At what monthly price would it be a bargain you'd sign up straight away?
|
||||
options:
|
||||
- key: eur0
|
||||
label: €0
|
||||
- key: eur10
|
||||
label: €10
|
||||
- key: eur25
|
||||
label: €25
|
||||
- key: eur50
|
||||
label: €50
|
||||
- key: eur100plus
|
||||
label: €100+
|
||||
- key: too_cheap
|
||||
heading: At what monthly price is it so cheap you'd doubt it's any good?
|
||||
options:
|
||||
- key: eur0
|
||||
label: €0
|
||||
- key: eur10
|
||||
label: €10
|
||||
- key: eur25
|
||||
label: €25
|
||||
- key: eur50
|
||||
label: €50
|
||||
- key: eur100plus
|
||||
label: €100+
|
||||
- key: worth_considering
|
||||
heading: At what monthly price would it feel expensive, but worth considering?
|
||||
options:
|
||||
- key: eur0
|
||||
label: €0
|
||||
- key: eur10
|
||||
label: €10
|
||||
- key: eur25
|
||||
label: €25
|
||||
- key: eur50
|
||||
label: €50
|
||||
- key: eur100plus
|
||||
label: €100+
|
||||
- { key: too_expensive, heading: "At what price would the journey feel too expensive?" }
|
||||
- { key: bargain, heading: "At what price would it be a bargain you'd sign up straight away?" }
|
||||
- { key: too_cheap, heading: "At what price is it so cheap you'd doubt it's any good?" }
|
||||
- { key: worth_considering, heading: "At what price would it feel expensive, but worth considering?" }
|
||||
price_title: Help us get it right
|
||||
price_note: Four quick questions on the monthly price, one at a time. Your answers are anonymous in our analytics (if you've allowed them) and arrive with your invitation request below.
|
||||
price_note: First tell us which pricing model you'd prefer, then answer four quick questions about price - one at a time. Anonymous in our analytics (if you've allowed them), and the answers arrive with your invitation request below.
|
||||
capabilities:
|
||||
- key: team_collaboration
|
||||
heading: Team collaboration
|
||||
|
||||
Reference in new issue
Block a user