diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AdvancedLogicEditorConditions.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AdvancedLogicEditorConditions.tsx index b99735277b..46e91d22a6 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AdvancedLogicEditorConditions.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AdvancedLogicEditorConditions.tsx @@ -1,4 +1,3 @@ -// @ts-nocheck import { getConditionOperatorOptions, getConditionValueOptions, diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsView.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsView.tsx index 64081f03a8..d493501282 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsView.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsView.tsx @@ -1,4 +1,3 @@ -// @ts-nocheck "use client"; import { AddEndingCardButton } from "@/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddEndingCardButton"; @@ -37,8 +36,6 @@ import { EditWelcomeCard } from "./EditWelcomeCard"; import { HiddenFieldsCard } from "./HiddenFieldsCard"; import { QuestionsDroppable } from "./QuestionsDroppable"; -// @ts-nocheck - interface QuestionsViewProps { localSurvey: TSurvey; setLocalSurvey: React.Dispatch>; diff --git a/packages/lib/templates.ts b/packages/lib/templates.ts index 9dac5a170a..329cf87c82 100644 --- a/packages/lib/templates.ts +++ b/packages/lib/templates.ts @@ -49,8 +49,10 @@ const surveyDefault: TTemplate["preset"] = { questions: [], }; -export const templates: TTemplate[] = [ - { +const cartAbandonmentSurvey = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + + return { name: "Cart Abandonment Survey", role: "productManager", industries: ["eCommerce"], @@ -61,13 +63,38 @@ export const templates: TTemplate[] = [ name: "Cart Abandonment Survey", questions: [ { - id: createId(), + id: reusableQuestionIds[0], html: { default: '

We noticed you left some items in your cart. We would love to understand why.

', }, type: TSurveyQuestionTypeEnum.CTA, - logic: [{ condition: "skipped", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Do you have 2 minutes to help us improve?" }, required: false, buttonLabel: { default: "Sure!" }, @@ -158,8 +185,33 @@ export const templates: TTemplate[] = [ ], }, { - id: createId(), - logic: [{ condition: "skipped", destination: "bxvvhol84ir34q2vsvr5kwl9" }], + id: reusableQuestionIds[1], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], type: TSurveyQuestionTypeEnum.Consent, headline: { default: "Would you like to receive a discount code via email?" }, required: false, @@ -175,7 +227,7 @@ export const templates: TTemplate[] = [ placeholder: { default: "example@email.com" }, }, { - id: "bxvvhol84ir34q2vsvr5kwl9", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Any additional comments or suggestions?" }, required: false, @@ -183,8 +235,13 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const siteAbandonmentSurvey = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + + return { name: "Site Abandonment Survey", role: "productManager", industries: ["eCommerce"], @@ -195,13 +252,38 @@ export const templates: TTemplate[] = [ name: "Site Abandonment Survey", questions: [ { - id: createId(), + id: reusableQuestionIds[0], html: { default: "

We noticed you're leaving our site without making a purchase. We would love to understand why.

", }, type: TSurveyQuestionTypeEnum.CTA, - logic: [{ condition: "skipped", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Do you have a minute?" }, required: false, buttonLabel: { default: "Sure!" }, @@ -292,8 +374,33 @@ export const templates: TTemplate[] = [ ], }, { - id: createId(), - logic: [{ condition: "skipped", destination: "bxvvhol84ir34q2vsvr5kwl9" }], + id: reusableQuestionIds[1], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], type: TSurveyQuestionTypeEnum.Consent, headline: { default: "Would you like to receive updates about new products and promotions?" }, required: false, @@ -309,7 +416,7 @@ export const templates: TTemplate[] = [ placeholder: { default: "example@email.com" }, }, { - id: "bxvvhol84ir34q2vsvr5kwl9", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Any additional comments or suggestions?" }, required: false, @@ -317,8 +424,13 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const productMarketFitSuperhuman = (): TTemplate => { + const reusableQuestionIds = [createId()]; + + return { name: "Product Market Fit (Superhuman)", role: "productManager", industries: ["saas"], @@ -335,7 +447,32 @@ export const templates: TTemplate[] = [ '

We would love to understand your user experience better. Sharing your insight helps a lot.

', }, type: TSurveyQuestionTypeEnum.CTA, - logic: [{ condition: "skipped", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "You are one of our power users! Do you have 5 minutes?" }, required: false, buttonLabel: { default: "Happy to help!" }, @@ -418,8 +555,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const onboardingSegmentation = (): TTemplate => { + return { name: "Onboarding Segmentation", role: "productManager", industries: ["saas"], @@ -521,8 +661,14 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const churnSurvey = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId(), createId(), createId()]; + const reusableOptionIds = [createId(), createId(), createId(), createId(), createId()]; + + return { name: "Churn Survey", role: "sales", industries: ["saas", "eCommerce", "other"], @@ -533,48 +679,229 @@ export const templates: TTemplate[] = [ name: "Churn Survey", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, shuffleOption: "none", logic: [ - { value: "Difficult to use", condition: "equals", destination: "sxwpskjgzzpmkgfxzi15inif" }, - { value: "It's too expensive", condition: "equals", destination: "mao94214zoo6c1at5rpuz7io" }, - { value: "I am missing features", condition: "equals", destination: "l054desub14syoie7n202vq4" }, - { value: "Poor customer service", condition: "equals", destination: "hdftsos1odzjllr7flj4m3j9" }, { - value: "I just didn't need it anymore", - condition: "equals", - destination: surveyDefault.endings[0].id, + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[0], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[1], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[1], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[2], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[3], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[4], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[4], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], }, ], choices: [ - { id: createId(), label: { default: "Difficult to use" } }, - { id: createId(), label: { default: "It's too expensive" } }, - { id: createId(), label: { default: "I am missing features" } }, - { id: createId(), label: { default: "Poor customer service" } }, - { id: createId(), label: { default: "I just didn't need it anymore" } }, + { id: reusableOptionIds[0], label: { default: "Difficult to use" } }, + { id: reusableOptionIds[1], label: { default: "It's too expensive" } }, + { id: reusableOptionIds[2], label: { default: "I am missing features" } }, + { id: reusableOptionIds[3], label: { default: "Poor customer service" } }, + { id: reusableOptionIds[4], label: { default: "I just didn't need it anymore" } }, ], headline: { default: "Why did you cancel your subscription?" }, required: true, subheader: { default: "We're sorry to see you leave. Help us do better:" }, }, { - id: "sxwpskjgzzpmkgfxzi15inif", + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "What would have made {{productName}} easier to use?" }, required: true, buttonLabel: { default: "Send" }, inputType: "text", }, { - id: "mao94214zoo6c1at5rpuz7io", + id: reusableQuestionIds[2], html: { default: '

We\'d love to keep you as a customer. Happy to offer a 30% discount for the next year.

', }, type: TSurveyQuestionTypeEnum.CTA, - logic: [{ condition: "clicked", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "isClicked", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Get 30% off for the next year!" }, required: true, buttonUrl: "https://formbricks.com", @@ -583,21 +910,71 @@ export const templates: TTemplate[] = [ dismissButtonLabel: { default: "Skip" }, }, { - id: "l054desub14syoie7n202vq4", + id: reusableQuestionIds[3], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[3], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "What features are you missing?" }, required: true, inputType: "text", }, { - id: "hdftsos1odzjllr7flj4m3j9", + id: reusableQuestionIds[4], html: { default: '

We aim to provide the best possible customer service. Please email our CEO and she will personally handle your issue.

', }, type: TSurveyQuestionTypeEnum.CTA, - logic: [{ condition: "clicked", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[4], + type: "question", + }, + operator: "isClicked", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "So sorry to hear 😔 Talk to our CEO directly!" }, required: true, buttonUrl: "mailto:ceo@company.com", @@ -607,8 +984,14 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const earnedAdvocacyScore = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId(), createId()]; + const reusableOptionIds = [createId(), createId(), createId(), createId()]; + + return { name: "Earned Advocacy Score (EAS)", role: "customerSuccess", industries: ["saas", "eCommerce", "other"], @@ -620,28 +1003,82 @@ export const templates: TTemplate[] = [ name: "Earned Advocacy Score (EAS)", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, - logic: [{ value: "No", condition: "equals", destination: "duz2qp8eftix9wty1l221x1h" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[1], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], shuffleOption: "none", choices: [ - { id: createId(), label: { default: "Yes" } }, - { id: createId(), label: { default: "No" } }, + { id: reusableOptionIds[0], label: { default: "Yes" } }, + { id: reusableOptionIds[1], label: { default: "No" } }, ], headline: { default: "Have you actively recommended {{productName}} to others?" }, required: true, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "yhfew1j3ng6luy7t7qynwj79" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + type: "question", + id: reusableQuestionIds[1], + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], + }, + ], headline: { default: "Great to hear! Why did you recommend us?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "duz2qp8eftix9wty1l221x1h", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "So sad. Why not?" }, required: true, @@ -649,13 +1086,42 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "yhfew1j3ng6luy7t7qynwj79", + id: reusableQuestionIds[3], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, - logic: [{ value: "No", condition: "equals", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + type: "question", + id: reusableQuestionIds[3], + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[3], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], shuffleOption: "none", choices: [ - { id: createId(), label: { default: "Yes" } }, - { id: createId(), label: { default: "No" } }, + { id: reusableOptionIds[2], label: { default: "Yes" } }, + { id: reusableOptionIds[3], label: { default: "No" } }, ], headline: { default: "Have you actively discouraged others from choosing {{productName}}?" }, required: true, @@ -670,8 +1136,22 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const improveTrialConversion = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId(), createId(), createId(), createId()]; + const reusableOptionIds = [ + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + ]; + + return { name: "Improve Trial Conversion", role: "sales", industries: ["saas"], @@ -682,73 +1162,263 @@ export const templates: TTemplate[] = [ name: "Improve Trial Conversion", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, shuffleOption: "none", logic: [ { - value: "I didn't get much value out of it", - condition: "equals", - destination: "aew2ymg51mffnt9db7duz9t3", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[0], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[1], + }, + ], }, { - value: "I expected something else", - condition: "equals", - destination: "rnrfydttavtsf2t2nfx1df7m", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[1], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], }, { - value: "It's too expensive for what it does", - condition: "equals", - destination: "x760wga1fhtr1i80cpssr7af", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[2], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], }, { - value: "I am missing a feature", - condition: "equals", - destination: "rbhww1pix03r6sl4xc511wqg", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[3], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[4], + }, + ], }, { - value: "I was just looking around", - condition: "equals", - destination: surveyDefault.endings[0].id, + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[4], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], }, ], choices: [ - { id: createId(), label: { default: "I didn't get much value out of it" } }, - { id: createId(), label: { default: "I expected something else" } }, - { id: createId(), label: { default: "It's too expensive for what it does" } }, - { id: createId(), label: { default: "I am missing a feature" } }, - { id: createId(), label: { default: "I was just looking around" } }, + { id: reusableOptionIds[0], label: { default: "I didn't get much value out of it" } }, + { id: reusableOptionIds[1], label: { default: "I expected something else" } }, + { id: reusableOptionIds[2], label: { default: "It's too expensive for what it does" } }, + { id: reusableOptionIds[3], label: { default: "I am missing a feature" } }, + { id: reusableOptionIds[4], label: { default: "I was just looking around" } }, ], headline: { default: "Why did you stop your trial?" }, required: true, subheader: { default: "Help us understand you better:" }, }, { - id: "aew2ymg51mffnt9db7duz9t3", + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "bqiyml1ym74ggx6htwdo7rlu" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[5], + }, + ], + }, + ], headline: { default: "Sorry to hear. What was the biggest problem using {{productName}}?" }, required: true, buttonLabel: { default: "Next" }, inputType: "text", }, { - id: "rnrfydttavtsf2t2nfx1df7m", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "bqiyml1ym74ggx6htwdo7rlu" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[5], + }, + ], + }, + ], headline: { default: "What did you expect {{productName}} would do for you?" }, required: true, buttonLabel: { default: "Next" }, inputType: "text", }, { - id: "x760wga1fhtr1i80cpssr7af", + id: reusableQuestionIds[3], html: { default: '

We\'re happy to offer you a 20% discount on a yearly plan.

', }, type: TSurveyQuestionTypeEnum.CTA, - logic: [{ condition: "clicked", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[3], + type: "question", + }, + operator: "isClicked", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Sorry to hear! Get 20% off the first year." }, required: true, buttonUrl: "https://formbricks.com/github", @@ -757,9 +1427,34 @@ export const templates: TTemplate[] = [ dismissButtonLabel: { default: "Skip" }, }, { - id: "rbhww1pix03r6sl4xc511wqg", + id: reusableQuestionIds[4], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "bqiyml1ym74ggx6htwdo7rlu" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[4], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[5], + }, + ], + }, + ], headline: { default: "Which features are you missing?" }, required: true, subheader: { default: "What would you like to achieve?" }, @@ -767,11 +1462,57 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "bqiyml1ym74ggx6htwdo7rlu", + id: reusableQuestionIds[5], type: TSurveyQuestionTypeEnum.OpenText, logic: [ - { condition: "submitted", destination: surveyDefault.endings[0].id }, - { condition: "skipped", destination: surveyDefault.endings[0].id }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[5], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[5], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, ], headline: { default: "How are you solving your problem now?" }, required: false, @@ -780,8 +1521,13 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const reviewPrompt = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + + return { name: "Review Prompt", role: "marketing", industries: ["saas", "eCommerce", "other"], @@ -792,9 +1538,38 @@ export const templates: TTemplate[] = [ name: "Review Prompt", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: 3, condition: "lessEqual", destination: "tk9wpw2gxgb8fa6pbpp3qq5l" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isLessThanOrEqual", + rightOperand: { + type: "static", + value: 3, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], range: 5, scale: "star", headline: { default: "How do you like {{productName}}?" }, @@ -804,10 +1579,35 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: createId(), + id: reusableQuestionIds[1], html: { default: '

This helps us a lot.

' }, type: TSurveyQuestionTypeEnum.CTA, - logic: [{ condition: "clicked", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isClicked", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Happy to hear 🙏 Please write a review for us!" }, required: true, buttonUrl: "https://formbricks.com/github", @@ -815,7 +1615,7 @@ export const templates: TTemplate[] = [ buttonExternal: true, }, { - id: "tk9wpw2gxgb8fa6pbpp3qq5l", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Sorry to hear! What is ONE thing we can do better?" }, required: true, @@ -826,8 +1626,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const interviewPrompt = (): TTemplate => { + return { name: "Interview Prompt", role: "productManager", industries: ["saas"], @@ -849,8 +1652,14 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const improveActivationRate = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId(), createId(), createId(), createId()]; + const reusableOptionIds = [createId(), createId(), createId(), createId(), createId()]; + + return { name: "Improve Activation Rate", role: "productManager", industries: ["saas"], @@ -861,37 +1670,129 @@ export const templates: TTemplate[] = [ name: "Onboarding Drop-Off Reasons", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, shuffleOption: "none", logic: [ { - value: "Difficult to set up or use", - condition: "equals", - destination: "r0zvi3vburf4hm7qewimzjux", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[1], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], }, { - value: "Lacked features/functionality", - condition: "equals", - destination: "rbwz3y6y9avzqcfj30nu0qj4", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[2], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], }, { - value: "Just haven't had the time", - condition: "equals", - destination: "gn6298zogd2ipdz7js17qy5i", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[3], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[4], + }, + ], }, { - value: "Something else", - condition: "equals", - destination: "c0exdyri3erugrv0ezkyseh6", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[4], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[5], + }, + ], }, ], choices: [ - { id: createId(), label: { default: "Didn't seem useful to me" } }, - { id: createId(), label: { default: "Difficult to set up or use" } }, - { id: createId(), label: { default: "Lacked features/functionality" } }, - { id: createId(), label: { default: "Just haven't had the time" } }, - { id: createId(), label: { default: "Something else" } }, + { id: reusableOptionIds[0], label: { default: "Didn't seem useful to me" } }, + { id: reusableOptionIds[1], label: { default: "Difficult to set up or use" } }, + { id: reusableOptionIds[2], label: { default: "Lacked features/functionality" } }, + { id: reusableOptionIds[3], label: { default: "Just haven't had the time" } }, + { id: reusableOptionIds[4], label: { default: "Something else" } }, ], headline: { default: "What's the main reason why you haven't finished setting up {{productName}}?", @@ -899,43 +1800,143 @@ export const templates: TTemplate[] = [ required: true, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "What made you think {{productName}} wouldn't be useful?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "r0zvi3vburf4hm7qewimzjux", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "What was difficult about setting up or using {{productName}}?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "rbwz3y6y9avzqcfj30nu0qj4", + id: reusableQuestionIds[3], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[3], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "What features or functionality were missing?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "gn6298zogd2ipdz7js17qy5i", + id: reusableQuestionIds[4], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[4], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "How could we make it easier for you to get started?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "c0exdyri3erugrv0ezkyseh6", + id: reusableQuestionIds[5], type: TSurveyQuestionTypeEnum.OpenText, logic: [], headline: { default: "What was it? Please explain:" }, @@ -946,8 +1947,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const uncoverStrengthsAndWeaknesses = (): TTemplate => { + return { name: "Uncover Strengths & Weaknesses", role: "productManager", industries: ["saas", "other"], @@ -995,8 +1999,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const productMarketFitShort = (): TTemplate => { + return { name: "Product Market Fit Survey (Short)", role: "productManager", industries: ["saas"], @@ -1038,8 +2045,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const marketAttribution = (): TTemplate => { + return { name: "Marketing Attribution", role: "marketing", industries: ["saas", "eCommerce"], @@ -1081,8 +2091,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, - { + }; +}; + +const changingSubscriptionExperience = (): TTemplate => { + return { name: "Changing Subscription Experience", role: "productManager", industries: ["saas"], @@ -1144,9 +2157,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const identifyCustomerGoals = (): TTemplate => { + return { name: "Identify Customer Goals", role: "productManager", industries: ["saas", "other"], @@ -1184,9 +2199,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const featureChaser = (): TTemplate => { + return { name: "Feature Chaser", role: "productManager", industries: ["saas"], @@ -1222,9 +2239,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const fakeDoorFollowUp = (): TTemplate => { + return { name: "Fake Door Follow-Up", role: "productManager", industries: ["saas", "eCommerce"], @@ -1272,9 +2291,14 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const feedbackBox = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId(), createId()]; + const reusableOptionIds = [createId(), createId()]; + + return { name: "Feedback Box", role: "productManager", industries: ["saas"], @@ -1285,40 +2309,166 @@ export const templates: TTemplate[] = [ name: "Feedback Box", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, shuffleOption: "none", + logic: [ - { value: "Bug report 🐞", condition: "equals", destination: "dnbiuq4l33l7jypcf2cg6vhh" }, - { value: "Feature Request 💡", condition: "equals", destination: "en9nuuevbf7g9oa9rzcs1l50" }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[0], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[1], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[1], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], + }, ], choices: [ - { id: createId(), label: { default: "Bug report 🐞" } }, - { id: createId(), label: { default: "Feature Request 💡" } }, + { id: reusableOptionIds[0], label: { default: "Bug report 🐞" } }, + { id: reusableOptionIds[1], label: { default: "Feature Request 💡" } }, ], headline: { default: "What's on your mind, boss?" }, required: true, subheader: { default: "Thanks for sharing. We'll get back to you asap." }, }, { - id: "dnbiuq4l33l7jypcf2cg6vhh", + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "a6c76m5oocw6xp9agf3d2tam" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], headline: { default: "What's broken?" }, required: true, subheader: { default: "The more detail, the better :)" }, inputType: "text", }, { - id: "a6c76m5oocw6xp9agf3d2tam", + id: reusableQuestionIds[2], html: { default: '

We will fix this as soon as possible. Do you want to be notified when we did?

', }, type: TSurveyQuestionTypeEnum.CTA, logic: [ - { condition: "clicked", destination: surveyDefault.endings[0].id }, - { condition: "skipped", destination: surveyDefault.endings[0].id }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "isClicked", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, ], headline: { default: "Want to stay in the loop?" }, required: false, @@ -1327,7 +2477,7 @@ export const templates: TTemplate[] = [ dismissButtonLabel: { default: "No, thanks" }, }, { - id: "en9nuuevbf7g9oa9rzcs1l50", + id: reusableQuestionIds[3], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Lovely, tell us more!" }, required: true, @@ -1338,9 +2488,13 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const integrationSetupSurvey = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + + return { name: "Integration Setup Survey", role: "productManager", industries: ["saas"], @@ -1351,9 +2505,38 @@ export const templates: TTemplate[] = [ name: "Integration Usage Survey", questions: [ { - id: "s6ss6znzxdwjod1hv16fow4w", + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: 4, condition: "greaterEqual", destination: "ef0qo3l8iisd517ikp078u1p" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isGreaterThanOrEqual", + rightOperand: { + type: "static", + value: 4, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], range: 5, scale: "number", headline: { default: "How easy was it to set this integration up?" }, @@ -1363,7 +2546,7 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: "mko13ptjj6tpi5u2pl7a5drz", + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Why was it hard?" }, required: false, @@ -1371,7 +2554,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "ef0qo3l8iisd517ikp078u1p", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "What other tools would you like to use with {{productName}}?" }, required: false, @@ -1380,9 +2563,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const newIntegrationSurvey = (): TTemplate => { + return { name: "New Integration Survey", role: "productManager", industries: ["saas"], @@ -1423,9 +2608,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const docsFeedback = (): TTemplate => { + return { name: "Docs Feedback", role: "productManager", industries: ["saas"], @@ -1468,9 +2655,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const NPS = (): TTemplate => { + return { name: "Net Promoter Score (NPS)", role: "customerSuccess", @@ -1499,9 +2688,12 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const customerSatisfactionScore = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + return { name: "Customer Satisfaction Score (CSAT)", role: "customerSuccess", industries: ["saas", "eCommerce", "other"], @@ -1512,9 +2704,38 @@ export const templates: TTemplate[] = [ name: "{{productName}} CSAT", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: 3, condition: "lessEqual", destination: "vyo4mkw4ln95ts4ya7qp2tth" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isLessThanOrEqual", + rightOperand: { + type: "static", + value: 3, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], range: 5, scale: "smiley", headline: { default: "How satisfied are you with your {{productName}} experience?" }, @@ -1524,16 +2745,41 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Lovely! Is there anything we can do to improve your experience?" }, required: false, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "vyo4mkw4ln95ts4ya7qp2tth", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Ugh, sorry! Is there anything we can do to improve your experience?" }, required: false, @@ -1542,9 +2788,20 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const collectFeedback = (): TTemplate => { + const reusableQuestionIds = [ + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + ]; + return { name: "Collect Feedback", role: "productManager", industries: ["other", "eCommerce"], @@ -1555,9 +2812,38 @@ export const templates: TTemplate[] = [ name: "Feedback Survey", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: "3", condition: "lessEqual", destination: "dlpa0371pe7rphmggy2sgbap" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isLessThanOrEqual", + rightOperand: { + type: "static", + value: 3, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], range: 5, scale: "star", headline: { default: "How do you rate your overall experience?" }, @@ -1568,9 +2854,34 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "gwo0fq5kug13e83fcour4n1w" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], + }, + ], headline: { default: "Lovely! What did you like about it?" }, required: true, longAnswer: true, @@ -1578,7 +2889,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "dlpa0371pe7rphmggy2sgbap", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Thanks for sharing! What did you not like?" }, required: true, @@ -1587,7 +2898,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "gwo0fq5kug13e83fcour4n1w", + id: reusableQuestionIds[3], type: TSurveyQuestionTypeEnum.Rating, range: 5, scale: "smiley", @@ -1598,7 +2909,7 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: createId(), + id: reusableQuestionIds[4], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Anything else you'd like to share with our team?" }, required: false, @@ -1607,9 +2918,8 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "sjbaghd1bi59pkjun2c97kw9", + id: reusableQuestionIds[5], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, - logic: [], choices: [ { id: createId(), label: { default: "Google" } }, { id: createId(), label: { default: "Social Media" } }, @@ -1622,7 +2932,7 @@ export const templates: TTemplate[] = [ shuffleOption: "none", }, { - id: createId(), + id: reusableQuestionIds[6], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Lastly, we'd love to respond to your feedback. Please share your email:" }, required: false, @@ -1632,9 +2942,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const identifyUpsellOpportunities = (): TTemplate => { + return { name: "Identify Upsell Opportunities", role: "sales", industries: ["saas"], @@ -1671,9 +2983,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const prioritizeFeatures = (): TTemplate => { + return { name: "Prioritize Features", role: "productManager", industries: ["saas"], @@ -1720,9 +3034,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const gaugeFeatureSatisfaction = (): TTemplate => { + return { name: "Gauge Feature Satisfaction", role: "productManager", industries: ["saas"], @@ -1754,9 +3070,11 @@ export const templates: TTemplate[] = [ endings: [getDefaultEndingCard([])], hiddenFields: hiddenFieldsDefault, }, - }, + }; +}; - { +const marketSiteClarity = (): TTemplate => { + return { name: "Marketing Site Clarity", role: "marketing", industries: ["saas", "eCommerce", "other"], @@ -1805,9 +3123,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const customerEffortScore = (): TTemplate => { + return { name: "Customer Effort Score (CES)", role: "productManager", industries: ["saas"], @@ -1838,9 +3158,13 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const rateCheckoutExperience = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + + return { name: "Rate Checkout Experience", role: "productManager", industries: ["eCommerce"], @@ -1851,9 +3175,38 @@ export const templates: TTemplate[] = [ name: "Rate Checkout Experience", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: 4, condition: "greaterEqual", destination: "lpof3d9t9hmnqvyjlpksmxd7" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isGreaterThanOrEqual", + rightOperand: { + type: "static", + value: 4, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], range: 5, scale: "number", headline: { default: "How easy or difficult was it to complete the checkout?" }, @@ -1863,16 +3216,41 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Sorry about that! What would have made it easier for you?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "lpof3d9t9hmnqvyjlpksmxd7", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Lovely! Is there anything we can do to improve your experience?" }, required: true, @@ -1881,9 +3259,13 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const measureSearchExperience = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + + return { name: "Measure Search Experience", role: "productManager", industries: ["saas", "eCommerce"], @@ -1894,9 +3276,38 @@ export const templates: TTemplate[] = [ name: "Measure Search Experience", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: 4, condition: "greaterEqual", destination: "adcs3d9t9hmnqvyjlpksmxd7" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isGreaterThanOrEqual", + rightOperand: { + type: "static", + value: 4, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], range: 5, scale: "number", headline: { default: "How relevant are these search results?" }, @@ -1906,16 +3317,41 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Ugh! What makes the results irrelevant for you?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "adcs3d9t9hmnqvyjlpksmxd7", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Lovely! Is there anything we can do to improve your experience?" }, required: true, @@ -1924,9 +3360,13 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const evaluateContentQuality = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + + return { name: "Evaluate Content Quality", role: "marketing", industries: ["other"], @@ -1937,9 +3377,38 @@ export const templates: TTemplate[] = [ name: "Evaluate Content Quality", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: 4, condition: "greaterEqual", destination: "adcs3d9t9hmnqvyjlpkswi38" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isGreaterThanOrEqual", + rightOperand: { + type: "static", + value: 4, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + ], range: 5, scale: "number", headline: { default: "How well did this article address what you were hoping to learn?" }, @@ -1949,16 +3418,41 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Hmpft! What were you hoping for?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "adcs3d9t9hmnqvyjlpkswi38", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Lovely! Is there anything else you would like us to cover?" }, required: true, @@ -1967,9 +3461,14 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const measureTaskAccomplishment = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId(), createId(), createId()]; + const reusableOptionIds = [createId(), createId(), createId()]; + + return { name: "Measure Task Accomplishment", role: "productManager", industries: ["saas"], @@ -1980,26 +3479,136 @@ export const templates: TTemplate[] = [ name: "Measure Task Accomplishment", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, shuffleOption: "none", logic: [ - { value: "Working on it, boss", condition: "equals", destination: "nq88udm0jjtylr16ax87xlyc" }, - { value: "Yes", condition: "equals", destination: "rjeac33gd13h3nnbrbid1fb2" }, - { value: "No", condition: "equals", destination: "u83zhr66knyfozccoqojx7bc" }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[1], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[0], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[1], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[2], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[4], + }, + ], + }, ], choices: [ - { id: createId(), label: { default: "Yes" } }, - { id: createId(), label: { default: "Working on it, boss" } }, - { id: createId(), label: { default: "No" } }, + { id: reusableOptionIds[0], label: { default: "Yes" } }, + { id: reusableOptionIds[1], label: { default: "Working on it, boss" } }, + { id: reusableOptionIds[2], label: { default: "No" } }, ], headline: { default: "Were you able to accomplish what you came here to do today?" }, required: true, }, { - id: "rjeac33gd13h3nnbrbid1fb2", + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: 4, condition: "greaterEqual", destination: "nq88udm0jjtylr16ax87xlyc" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isGreaterThanOrEqual", + rightOperand: { + type: "static", + value: 4, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], + }, + ], range: 5, scale: "number", headline: { default: "How easy was it to achieve your goal?" }, @@ -2009,11 +3618,41 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: "s0999bhpaz8vgf7ps264piek", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, logic: [ - { condition: "submitted", destination: surveyDefault.endings[0].id }, - { condition: "skipped", destination: surveyDefault.endings[0].id }, + { + id: createId(), + conditions: { + id: createId(), + connector: "or", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "isSubmitted", + }, + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, ], headline: { default: "What made it hard?" }, required: false, @@ -2021,11 +3660,41 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "nq88udm0jjtylr16ax87xlyc", + id: reusableQuestionIds[3], type: TSurveyQuestionTypeEnum.OpenText, logic: [ - { condition: "skipped", destination: surveyDefault.endings[0].id }, - { condition: "submitted", destination: surveyDefault.endings[0].id }, + { + id: createId(), + conditions: { + id: createId(), + connector: "or", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[3], + type: "question", + }, + operator: "isSubmitted", + }, + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, ], headline: { default: "Great! What did you come here to do today?" }, required: false, @@ -2033,7 +3702,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "u83zhr66knyfozccoqojx7bc", + id: reusableQuestionIds[4], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "What stopped you?" }, required: true, @@ -2043,9 +3712,25 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const identifySignUpBarriers = (): TTemplate => { + const reusableQuestionIds = [ + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + ]; + + const reusableOptionIds = [createId(), createId(), createId(), createId(), createId()]; + + return { name: "Identify Sign Up Barriers", role: "marketing", industries: ["saas", "eCommerce", "other"], @@ -2056,13 +3741,38 @@ export const templates: TTemplate[] = [ name: "{{productName}} Sign Up Barriers", questions: [ { - id: createId(), + id: reusableQuestionIds[0], html: { default: '

You seem to be considering signing up. Answer four questions and get 10% on any plan.

', }, type: TSurveyQuestionTypeEnum.CTA, - logic: [{ condition: "skipped", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Answer this short survey, get 10% off!" }, required: false, buttonLabel: { default: "Get 10% discount" }, @@ -2070,9 +3780,38 @@ export const templates: TTemplate[] = [ dismissButtonLabel: { default: "No, thanks" }, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.Rating, - logic: [{ value: "5", condition: "equals", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: 5, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], range: 5, scale: "number", headline: { default: "How likely are you to sign up for {{productName}}?" }, @@ -2082,72 +3821,299 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: createId(), + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, shuffleOption: "none", logic: [ { - value: "May not have what I'm looking for", - condition: "equals", - destination: "atiw0j1oykb77zr0b7q4tixu", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[0], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], }, { - value: "Still comparing options", - condition: "equals", - destination: "j7jkpolm5xl7u0zt3g0e4z7d", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[1], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[4], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[2], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[5], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[3], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[6], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[4], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[7], + }, + ], }, - { value: "Seems complicated", condition: "equals", destination: "t5gvag2d7kq311szz5iyiy79" }, - { value: "Pricing is a concern", condition: "equals", destination: "or0yhhrof753sq9ug4mdavgz" }, - { value: "Something else", condition: "equals", destination: "v0pq1qcnm6ohiry5ywcd91qq" }, ], choices: [ - { id: createId(), label: { default: "May not have what I'm looking for" } }, - { id: createId(), label: { default: "Still comparing options" } }, - { id: createId(), label: { default: "Seems complicated" } }, - { id: createId(), label: { default: "Pricing is a concern" } }, - { id: createId(), label: { default: "Something else" } }, + { id: reusableOptionIds[0], label: { default: "May not have what I'm looking for" } }, + { id: reusableOptionIds[1], label: { default: "Still comparing options" } }, + { id: reusableOptionIds[2], label: { default: "Seems complicated" } }, + { id: reusableOptionIds[3], label: { default: "Pricing is a concern" } }, + { id: reusableOptionIds[4], label: { default: "Something else" } }, ], headline: { default: "What is holding you back from trying {{productName}}?" }, required: true, }, { - id: "atiw0j1oykb77zr0b7q4tixu", + id: reusableQuestionIds[3], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "k3q0vt1ko0bzbsq076p7lnys" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[3], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[8], + }, + ], + }, + ], headline: { default: "What do you need but {{productName}} does not offer?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "j7jkpolm5xl7u0zt3g0e4z7d", + id: reusableQuestionIds[4], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "k3q0vt1ko0bzbsq076p7lnys" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[4], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[8], + }, + ], + }, + ], headline: { default: "What options are you looking at?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "t5gvag2d7kq311szz5iyiy79", + id: reusableQuestionIds[5], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "k3q0vt1ko0bzbsq076p7lnys" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[5], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[8], + }, + ], + }, + ], headline: { default: "What seems complicated to you?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "or0yhhrof753sq9ug4mdavgz", + id: reusableQuestionIds[6], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "k3q0vt1ko0bzbsq076p7lnys" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[6], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[8], + }, + ], + }, + ], headline: { default: "What are you concerned about regarding pricing?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "v0pq1qcnm6ohiry5ywcd91qq", + id: reusableQuestionIds[7], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Please explain:" }, required: true, @@ -2155,7 +4121,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "k3q0vt1ko0bzbsq076p7lnys", + id: reusableQuestionIds[8], html: { default: '

Thanks a lot for taking the time to share feedback 🙏

', @@ -2170,9 +4136,11 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const buildProductRoadmap = (): TTemplate => { + return { name: "Build Product Roadmap", role: "productManager", industries: ["saas"], @@ -2207,9 +4175,12 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const understandPurchaseIntention = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + return { name: "Understand Purchase Intention", role: "sales", industries: ["eCommerce"], @@ -2220,13 +4191,121 @@ export const templates: TTemplate[] = [ name: "Purchase Intention Survey", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, logic: [ - { value: "2", condition: "lessEqual", destination: "y19mwcmstlc7pi7s4izxk1ll" }, - { value: "3", condition: "equals", destination: "zm1hs8qkeuidh3qm0hx8pnw7" }, - { value: "4", condition: "equals", destination: "zm1hs8qkeuidh3qm0hx8pnw7" }, - { value: "5", condition: "equals", destination: surveyDefault.endings[0].id }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isLessThanOrEqual", + rightOperand: { + type: "static", + value: 2, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[1], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: 3, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: 4, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: 5, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, ], range: 5, scale: "number", @@ -2237,11 +4316,41 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: "y19mwcmstlc7pi7s4izxk1ll", + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, logic: [ - { condition: "submitted", destination: surveyDefault.endings[0].id }, - { condition: "skipped", destination: surveyDefault.endings[0].id }, + { + id: createId(), + conditions: { + id: createId(), + connector: "or", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, ], headline: { default: "Got it. What's your primary reason for visiting today?" }, required: false, @@ -2249,7 +4358,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "zm1hs8qkeuidh3qm0hx8pnw7", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "What, if anything, is holding you back from making a purchase today?" }, required: true, @@ -2258,9 +4367,13 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const improveNewsletterContent = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId()]; + + return { name: "Improve Newsletter Content", role: "marketing", industries: ["eCommerce", "saas", "other"], @@ -2271,11 +4384,65 @@ export const templates: TTemplate[] = [ name: "Improve Newsletter Content", questions: [ { - id: createId(), + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.Rating, logic: [ - { value: "5", condition: "equals", destination: "l2q1chqssong8n0xwaagyl8g" }, - { value: "5", condition: "lessThan", destination: "k3s6gm5ivkc5crpycdbpzkpa" }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: 5, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "isLessThan", + rightOperand: { + type: "static", + value: 5, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[1], + }, + ], + }, ], range: 5, scale: "smiley", @@ -2286,11 +4453,41 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: "k3s6gm5ivkc5crpycdbpzkpa", + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, logic: [ - { condition: "submitted", destination: surveyDefault.endings[0].id }, - { condition: "skipped", destination: surveyDefault.endings[0].id }, + { + id: createId(), + conditions: { + id: createId(), + connector: "or", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSkipped", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, ], headline: { default: "What would have made this weeks newsletter more helpful?" }, required: false, @@ -2298,7 +4495,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "l2q1chqssong8n0xwaagyl8g", + id: reusableQuestionIds[2], html: { default: '

Who thinks like you? You\'d do us a huge favor if you\'d share this weeks episode with your brain friend!

', @@ -2313,9 +4510,21 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const evaluateAProductIdea = (): TTemplate => { + const reusableQuestionIds = [ + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + createId(), + ]; + return { name: "Evaluate a Product Idea", role: "productManager", industries: ["saas", "other"], @@ -2326,7 +4535,7 @@ export const templates: TTemplate[] = [ name: "Evaluate a Product Idea", questions: [ { - id: createId(), + id: reusableQuestionIds[0], html: { default: '

We respect your time and kept it short 🤸

', @@ -2342,11 +4551,65 @@ export const templates: TTemplate[] = [ dismissButtonLabel: { default: "Skip" }, }, { - id: createId(), + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.Rating, logic: [ - { value: "3", condition: "lessEqual", destination: "ndacjg9lqf5jcpq9w8ote666" }, - { value: "4", condition: "greaterEqual", destination: "jmzgbo73cfjswlvhoynn7o0q" }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isLessThanOrEqual", + rightOperand: { + type: "static", + value: 3, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isGreaterThanOrEqual", + rightOperand: { + type: "static", + value: 4, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], + }, ], range: 5, scale: "number", @@ -2358,7 +4621,7 @@ export const templates: TTemplate[] = [ }, { - id: "ndacjg9lqf5jcpq9w8ote666", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "What's most difficult for you when it comes to [PROBLEM AREA]?" }, required: true, @@ -2366,7 +4629,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "jmzgbo73cfjswlvhoynn7o0q", + id: reusableQuestionIds[3], html: { default: '


Read the text below, then answer 2 questions:


Insert concept brief here. Add necessary details but keep it concise and easy to understand.

', @@ -2379,11 +4642,65 @@ export const templates: TTemplate[] = [ dismissButtonLabel: { default: "Skip" }, }, { - id: createId(), + id: reusableQuestionIds[4], type: TSurveyQuestionTypeEnum.Rating, logic: [ - { value: "3", condition: "lessEqual", destination: "mmiuun3z4e7gk4ufuwh8lq8q" }, - { value: "4", condition: "greaterEqual", destination: "gvzevzw4hkqd6dmlkcly6kd1" }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[4], + type: "question", + }, + operator: "isLessThanOrEqual", + rightOperand: { + type: "static", + value: 3, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[5], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[4], + type: "question", + }, + operator: "isGreaterThanOrEqual", + rightOperand: { + type: "static", + value: 4, + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[6], + }, + ], + }, ], range: 5, scale: "number", @@ -2394,16 +4711,41 @@ export const templates: TTemplate[] = [ isColorCodingEnabled: false, }, { - id: "mmiuun3z4e7gk4ufuwh8lq8q", + id: reusableQuestionIds[5], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: "bqmnpyku9etsgbtb322luzb2" }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[5], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[7], + }, + ], + }, + ], headline: { default: "Got it. Why wouldn't this feature be valuable to you?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "gvzevzw4hkqd6dmlkcly6kd1", + id: reusableQuestionIds[6], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Got it. What would be most valuable to you in this feature?" }, required: true, @@ -2411,7 +4753,7 @@ export const templates: TTemplate[] = [ inputType: "text", }, { - id: "bqmnpyku9etsgbtb322luzb2", + id: reusableQuestionIds[7], type: TSurveyQuestionTypeEnum.OpenText, headline: { default: "Anything else we should keep in mind?" }, required: false, @@ -2420,9 +4762,15 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; - { +const understandLowEngagement = (): TTemplate => { + const reusableQuestionIds = [createId(), createId(), createId(), createId(), createId(), createId()]; + + const reusableOptionIds = [createId(), createId(), createId(), createId()]; + + return { name: "Understand Low Engagement", role: "productManager", industries: ["saas"], @@ -2433,76 +4781,299 @@ export const templates: TTemplate[] = [ name: "Reasons for Low Engagement", questions: [ { - id: "aq9dafe9nxe0kpm67b1os2z9", + id: reusableQuestionIds[0], type: TSurveyQuestionTypeEnum.MultipleChoiceSingle, shuffleOption: "none", logic: [ - { value: "Difficult to use", condition: "equals", destination: "r0zvi3vburf4hm7qewimzjux" }, { - value: "Found a better alternative", - condition: "equals", - destination: "g92s5wetp51ps6afmc6y7609", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[0], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[1], + }, + ], }, { - value: "Just haven't had the time", - condition: "equals", - destination: "gn6298zogd2ipdz7js17qy5i", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[1], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[2], + }, + ], }, { - value: "Lacked features I need", - condition: "equals", - destination: "rbwz3y6y9avzqcfj30nu0qj4", + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[2], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[3], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: reusableOptionIds[3], + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[4], + }, + ], + }, + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[0], + type: "question", + }, + operator: "equals", + rightOperand: { + type: "static", + value: "other", + }, + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: reusableQuestionIds[5], + }, + ], }, - { value: "Other", condition: "equals", destination: "c0exdyri3erugrv0ezkyseh6" }, ], choices: [ - { id: "xoqb0wjjsk4t0lx0i7jrhx26", label: { default: "Difficult to use" } }, - { id: "p768nlw47ndehtgzx6m82dr6", label: { default: "Found a better alternative" } }, - { id: "izt28ma5ep3s92531owxj1vg", label: { default: "Just haven't had the time" } }, - { id: "dhkp2wb9e1tv7kfu8csjhzbh", label: { default: "Lacked features I need" } }, + { id: reusableOptionIds[0], label: { default: "Difficult to use" } }, + { id: reusableOptionIds[1], label: { default: "Found a better alternative" } }, + { id: reusableOptionIds[2], label: { default: "Just haven't had the time" } }, + { id: reusableOptionIds[3], label: { default: "Lacked features I need" } }, { id: "other", label: { default: "Other" } }, ], headline: { default: "What's the main reason you haven't been back to {{productName}} recently?" }, required: true, }, { - id: "r0zvi3vburf4hm7qewimzjux", + id: reusableQuestionIds[1], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[1], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "What's difficult about using {{productName}}?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "g92s5wetp51ps6afmc6y7609", + id: reusableQuestionIds[2], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[2], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Got it. Which alternative are you using instead?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "gn6298zogd2ipdz7js17qy5i", + id: reusableQuestionIds[3], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[3], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Got it. How could we make it easier for you to get started?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "rbwz3y6y9avzqcfj30nu0qj4", + id: reusableQuestionIds[4], type: TSurveyQuestionTypeEnum.OpenText, - logic: [{ condition: "submitted", destination: surveyDefault.endings[0].id }], + logic: [ + { + id: createId(), + conditions: { + id: createId(), + connector: "and", + conditions: [ + { + id: createId(), + leftOperand: { + id: reusableQuestionIds[4], + type: "question", + }, + operator: "isSubmitted", + }, + ], + }, + actions: [ + { + id: createId(), + objective: "jumpToQuestion", + target: surveyDefault.endings[0].id, + }, + ], + }, + ], headline: { default: "Got it. What features or functionality were missing?" }, required: true, placeholder: { default: "Type your answer here..." }, inputType: "text", }, { - id: "c0exdyri3erugrv0ezkyseh6", + id: reusableQuestionIds[5], type: TSurveyQuestionTypeEnum.OpenText, logic: [], headline: { default: "Please add more details:" }, @@ -2512,7 +5083,49 @@ export const templates: TTemplate[] = [ }, ], }, - }, + }; +}; + +export const templates: TTemplate[] = [ + cartAbandonmentSurvey(), + siteAbandonmentSurvey(), + productMarketFitSuperhuman(), + onboardingSegmentation(), + churnSurvey(), + earnedAdvocacyScore(), + improveTrialConversion(), + reviewPrompt(), + interviewPrompt(), + improveActivationRate(), + uncoverStrengthsAndWeaknesses(), + productMarketFitShort(), + marketAttribution(), + changingSubscriptionExperience(), + identifyCustomerGoals(), + featureChaser(), + fakeDoorFollowUp(), + feedbackBox(), + integrationSetupSurvey(), + newIntegrationSurvey(), + docsFeedback(), + NPS(), + customerSatisfactionScore(), + collectFeedback(), + identifyUpsellOpportunities(), + prioritizeFeatures(), + gaugeFeatureSatisfaction(), + marketSiteClarity(), + customerEffortScore(), + rateCheckoutExperience(), + measureSearchExperience(), + evaluateContentQuality(), + measureTaskAccomplishment(), + identifySignUpBarriers(), + buildProductRoadmap(), + understandPurchaseIntention(), + improveNewsletterContent(), + evaluateAProductIdea(), + understandLowEngagement(), ]; export const customSurvey = {