AI chat ยท showFrame(prompt + hint)

๐Ÿ”ฎTravel Personality Quiz

Five either/or questions reveal a travel archetype, and the archetype (plus its interests, folded into the hint) plans a matching trip.

Jump to How it works Sample code Customize it

What it does

Five A/B questions. Tally the answers into one of a few archetypes (โ€œThe Culture Vultureโ€), show a fun result card, then let the AI plan a trip that matches. The archetype's descriptive hint โ€” with its interest tags folded in โ€” does the personalization.

How it works

Each archetype carries a written hint and a list of interests. At the end you fold the interests into the hint string and hand off.

Build it in 3 steps

1

Define archetypes with a hint + interests

Each result type has a name, a descriptive hint sentence, and an interests array.

2

Score the answers

Count A vs. B; pick the archetype (or a โ€œmixโ€).

3

Fold interests into the hint and hand off

Append Interests: โ€ฆ to the archetype's hint, then call showFrame().

The showFrame() call

The archetype's hint plus its interests โ€” as one string โ€” personalize an otherwise generic prompt.

window.mindtrip.showFrame(null, {
  destination: 'New York City',
  prompt: 'Plan me a New York City trip that matches my travel personality.',
  hint:   `${archetype.hint} Interests: ${archetype.vibes.join(', ')}.`,
  id: 'nyc-quiz-result'
});

Parameters used here

ParameterWhat it carries in this example
destinationThe city.
promptA generic opener โ€” the personality lives in the hint, not here.
hintThe archetype description plus its interests, folded into one string (per Mindtrip best practice).
idTracking slug.
๐Ÿ’กInterests are folded into the hint string rather than passed as a separate vibes parameter โ€” the recommended pattern. One hint carries everything.

Sample code

A self-contained, working version of this experience. Copy it into an .html file, change the destination and content, and it runs. The Mindtrip embed script must be on the page (shown at the top).

<!-- Required on every page: the Mindtrip embed -->
<script src="https://partner.mindtrip.ai/overlay/embed.js?orgid=your-org-id" defer></script>

<div id="quiz"></div>
<div id="result" style="display:none">
  <h2 id="r-name"></h2>
  <button onclick="plan()">Plan My Trip โ†’</button>
</div>

<script>
  const questions = [
    { q: 'Your ideal morning?', a: 'A quiet museum', b: 'Brunch with a crowd' },
    { q: 'Your ideal night?',   a: 'Jazz in a small room', b: 'Rooftop bar hopping' }
    // ...add up to 5
  ];

  const archetypes = {
    A: {
      name: 'The Culture Vulture',
      hint: 'This visitor is a cultural traveler โ€” museums, jazz, history, slow exploration.',
      vibes: ['art', 'history', 'food']
    },
    B: {
      name: 'The Social Explorer',
      hint: 'This visitor is high-energy โ€” rooftops, trendy restaurants, nightlife.',
      vibes: ['nightlife', 'food', 'shopping']
    }
  };

  let answers = [];
  // ...render each question, push 'A'/'B' to answers on click, then call showResult()

  let chosen;   // set by showResult() based on the A/B tally

  function showResult() {
    const aCount = answers.filter(x => x === 'A').length;
    chosen = aCount >= questions.length / 2 ? archetypes.A : archetypes.B;
    document.getElementById('r-name').textContent = chosen.name;
    document.getElementById('result').style.display = 'block';
  }

  function plan() {
    window.mindtrip.showFrame(null, {
      destination: 'New York City',
      prompt: 'Plan me a New York City trip that matches my travel personality.',
      hint:   `${chosen.hint} Interests: ${chosen.vibes.join(', ')}.`,
      id: 'nyc-quiz-result'
    });
  }
</script>

Customize it for your destination

Rewrite the questions and archetypes

Keep the questions playful and the archetypes flattering โ€” people share results they like. The real work is in each archetype's hint: make it a rich, specific description of that traveler.

Keep interests in the hint

Fold the interests into the hint string (as shown) rather than passing a separate vibes parameter โ€” that's the recommended Mindtrip pattern.

Mindtrip for Business Labs โ€” Travel Personality Quiz Questions? Contact your Mindtrip account team.