Everything you need to add AI-powered travel planning to your destination website β from a single button to a full trip-planning form. Written for developers and agencies.
The Mindtrip Partner Embed adds a slide-out AI travel assistant to any page on your site. Visitors can chat with it to get recommendations, build itineraries, and search flights β all without leaving your site.
You control what the AI opens, what question it asks, and where it navigates. Everything is triggered by ordinary HTML elements (links, buttons, forms) decorated with special Mindtrip classes or attributes.
Deep-link to a specific attraction, restaurant, neighborhood, or curated guide inside Mindtrip.
Pre-fill the chat with a question so the AI is already answering when the panel opens.
Open a specific Mindtrip section β flights, a trip builder, or an inspiration guide.
Collect traveler preferences on your site and pass them to the AI via the JavaScript API.
Paste this single <script> tag into the <head> of every page where you want the assistant to appear. Replace your-org-id with the ID Mindtrip provides.
<!-- Add to <head> on every page --> <script src="https://partner.mindtrip.ai/overlay/embed.js?orgid=your-org-id" defer></script>
defer attribute is required. It tells the browser to load the script after the page HTML is parsed, which prevents the embed from blocking page render.
If your site uses GTM, add it at the very top of <head> before the Mindtrip script. Mindtrip fires standard events that GTM can pick up automatically.
<!-- GTM snippet (top of <head>) --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
The most common pattern. Clicking the button opens the slide-out panel with a pre-filled AI question. Use this on attraction pages, blog articles, or anywhere you want to invite a conversation.
<form> with class="mindtrip-form"<input> with class="mindtrip-prompt" β this is the question<button> with class="mindtrip-button"<!-- Minimal example --> <form class="mindtrip-form"> <input type="hidden" class="mindtrip-prompt" value="What's the best time of year to visit New York City?"> <button class="mindtrip-button">Ask AI</button> </form>
class="mindtrip-button". The embed script intercepts clicks on this class. Without it, clicking the button does nothing. You can combine it with your own CSS classes: class="mindtrip-button btn btn-primary".
On the Things To Do page, each attraction has an "Ask AI" button pre-loaded with a relevant question about that specific place.
<!-- From things-to-do.html β Times Square Ask AI --> <form class="mindtrip-form"> <input type="hidden" class="mindtrip-prompt" value="What's worth knowing about Times Square β best time to visit, what to do there, and what to skip?"> <button id="place-times-square-ask" class="mindtrip-button btn-outline btn-sm"> Ask AI </button> </form>
For a text area where the visitor types their own query, swap the hidden <input> for a visible <textarea>. The embed reads whatever the visitor typed.
<!-- From flights.html β free-text flight search --> <form class="mindtrip-form"> <textarea class="mindtrip-prompt" placeholder="Flying from London in late October, open to JFK or Newarkβ¦" rows="4"></textarea> <button class="mindtrip-button">Search Flights</button> </form>
Use an inline hash link to deep-link directly to a specific attraction, restaurant, neighborhood, or curated guide. This opens the Mindtrip panel to that entity's detail page β no chat, no prompt, just the place.
<a href="#mindtrip.ai/location/city/country/entity-id?id=tracking-id"> Place name </a>
<!-- From blog.html β clickable place names in article body --> <a href="#mindtrip.ai/location/new-york/united-states/at-GhbwGq3N?id=blog-place-met" class="place-link"> The Metropolitan Museum of Art </a>
<!-- From itineraries.html β View Guide button --> <a href="#mindtrip.ai/inspiration/trip-new-york-city-april-2026/in-7KKgM5g1?id=guide-apr-view" class="mindtrip-button btn-sm"> View Guide </a>
at-GhbwGq3N (attraction), re-XXXXXX (restaurant), or lo-XXXXXX (neighborhood). See Section 07 for the full breakdown.
Use a mindtrip-path input inside a form to navigate the slide-out panel to a specific Mindtrip internal route β for example, the flights page, a trip builder, or a specific inspiration guide.
<form class="mindtrip-form"> <input type="hidden" class="mindtrip-path" value="/internal/path/here"> <button class="mindtrip-button">Open</button> </form>
| Destination | Path value |
|---|---|
| New trip builder | /chat/new/trip |
| A specific inspiration guide | /inspiration/guide-slug/in-XXXXXXXX |
| A specific city guide | /inspiration/city-guide-new-york-city-new-york/in-b3EoCdla |
mindtrip-path to the flights page. The flights embed handles its own routing. Adding a path input there causes an error in the slide-out panel. Use only mindtrip-prompt + mindtrip-button on flight search forms.
<!-- From itineraries.html β opens the guide directly --> <form class="mindtrip-form"> <input type="hidden" class="mindtrip-path" value="/inspiration/city-guide-new-york-city-new-york/in-b3EoCdla"> <button id="itinerary-featured-view" class="mindtrip-button btn-lg">View This Guide</button> </form> <!-- Separate form β customize/plan from the same guide --> <form class="mindtrip-form"> <input type="hidden" class="mindtrip-prompt" value="I want to plan a New York City trip based on the City Guide: New York City, New York itinerary. Help me customize it for my travel style, dates, and preferences."> <button id="itinerary-featured-customize" class="mindtrip-button btn-outline btn-lg">Plan from This Guide</button> </form>
The most powerful pattern. Build a form on your site that collects traveler preferences β dates, group type, budget, interests β then call the Mindtrip JavaScript API to open the panel with all that context already loaded.
This uses window.mindtrip.showFrame() directly, giving you full control over what the AI receives.
window.mindtrip.showFrame(event, { destination: 'New York City', // Sets the destination context prompt: 'Plan me a trip to New York City', // The visible opener hint: 'Duration: 5 days. Season: Summer. Traveling as: Couple. ' + 'Budget: mid-range. Interests: food, art, nightlife.', // β ALL structured data goes here id: 'plan-a-trip-form' // Tracking ID });
| Parameter | Type | Description |
|---|---|---|
destination |
string | The destination city or region name. |
prompt |
string | The clean, conversational opening message the AI responds to. Keep this simple β it's what the visitor effectively "says." |
hint |
string | Background context the AI receives silently. Put all your structured form data here as labeled sentences β duration, season, group type, budget, interests, and notes. The visitor doesn't see this. (Best practice: fold everything into this one string rather than passing separate parameters.) |
id |
string | A unique tracking ID for analytics. Use a descriptive slug: homepage-hero-btn, plan-a-trip-form. |
This is the full implementation from plan-a-trip.html. Copy and adapt it for your destination.
<!-- 1. The form collects traveler preferences --> <form onsubmit="return false"> <!-- When? --> <select id="field-when"> <option value="">When are you going?</option> <option value="Spring">Spring</option> <option value="Summer">Summer</option> <option value="Fall">Fall</option> <option value="Winter">Winter</option> </select> <!-- How long? --> <select id="field-duration"> <option value="">How long?</option> <option value="A weekend (2β3 days)">Weekend</option> <option value="4β5 days">4β5 days</option> <option value="A week">A week</option> <option value="10+ days">10+ days</option> </select> <!-- Vibe chips β each button toggles a .selected class --> <div class="vibe-chips"> <button type="button" class="vibe-btn" data-vibe="food">π Food & Drink</button> <button type="button" class="vibe-btn" data-vibe="art">π¨ Art & Museums</button> <button type="button" class="vibe-btn" data-vibe="nightlife">π· Nightlife</button> <button type="button" class="vibe-btn" data-vibe="outdoors">π³ Parks & Outdoors</button> <button type="button" class="vibe-btn" data-vibe="shopping">ποΈ Shopping</button> </div> <!-- Free text --> <textarea id="field-extra" placeholder="Anything to add? e.g. We love walking, staying in Brooklynβ¦" ></textarea> <!-- Submit β plain button, no mindtrip-button class needed here --> <button type="button" onclick="launchPlanner()"> Start Planning β </button> </form> <!-- 2. The JavaScript reads the form and opens the panel --> <script> // Vibe chip toggle document.querySelectorAll('.vibe-btn').forEach(btn => { btn.addEventListener('click', () => btn.classList.toggle('selected')); }); function launchPlanner() { const when = document.getElementById('field-when').value; const duration = document.getElementById('field-duration').value; const extra = document.getElementById('field-extra').value.trim(); const vibes = Array.from(document.querySelectorAll('.vibe-btn.selected')) .map(b => b.dataset.vibe); // Build the silent hint from ALL structured form data β including interests const hintParts = []; if (duration) hintParts.push(`Duration: ${duration}`); if (when) hintParts.push(`Season: ${when}`); if (vibes.length) hintParts.push(`Interests: ${vibes.join(', ')}`); if (extra) hintParts.push(`Notes: ${extra}`); window.mindtrip.showFrame(null, { destination: 'New York City', prompt: 'Plan me a trip to New York City', hint: hintParts.join('. '), id: 'plan-a-trip-form' }); } </script>
prompt as what the visitor "says" and hint as a sticky note you hand the AI behind the scenes. Keep prompt short and natural. Load hint with all the structured context (duration, season, group size, extra notes). This keeps the conversation opening clean while ensuring the AI has everything it needs.
Every place in Mindtrip β attraction, restaurant, neighborhood, guide β has a unique entity ID. You need these IDs to build inline hash links (Pattern 2). Mindtrip provides them; you don't generate them yourself.
| Type | ID prefix | Example | Used for |
|---|---|---|---|
| Attraction / landmark | at- |
at-GhbwGq3N |
The Met, Central Park, High Line, Brooklyn Bridge |
| Restaurant / bar | re- |
re-4WElfDso |
Specific restaurant pages |
| Neighborhood | lo- |
lo-oXvFk79O |
SoHo, Williamsburg, Harlem |
| Inspiration guide | in- |
in-7KKgM5g1 |
Curated itineraries and city guides |
| Place | Entity ID |
|---|---|
| The Metropolitan Museum of Art | at-GhbwGq3N |
| Central Park | at-5tEaBpEE |
| The High Line | at-i2iexvzk |
| Brooklyn Bridge | at-XXXXXXXX |
| Williamsburg Bridge | at-OMpilkb2 |
| One World Observatory | at-GBzFvTDW |
| Times Square | at-Gbg5HGPC |
| Chelsea Market | at-A0fHUTfE |
| Di Fara Pizza | re-4WElfDso |
| Peter Luger Steakhouse | re-XXXXXXXX |
| SoHo neighborhood | lo-oXvFk79O |
| Williamsburg neighborhood | lo-IKbQxEHk |
| Harlem neighborhood | lo-q0YzPRAa |
| City Guide: New York City | in-b3EoCdla |
| Trip to NYC β April 2026 | in-7KKgM5g1 |
| Trip to NYC β December 2026 | in-RIy5GN3V |
| NYC Highlights guide | in-ZOUDz0af |
| 10 Day Deep Dive guide | in-VctdSPgA |
XXXXXXXX above are placeholders to be filled in.
Every button and link should carry a unique id attribute (for forms) or ?id= query parameter (for inline links). Mindtrip uses these to report which CTAs drive the most engagement.
Use lowercase kebab-case. Start with the page, then the element, optionally the action:
<button id="things-to-do-central-park-ask" class="mindtrip-button btn-sm">Ask AI</button>
<a href="#mindtrip.ai/location/new-york/united-states/at-5tEaBpEE?id=blog-place-central-park"> Central Park </a>
| Mistake | What happens | Fix |
|---|---|---|
Button missing class="mindtrip-button" |
Clicking the button does nothing. The embed never sees it. | Add mindtrip-button to the button's class list. |
Two actions in one form (both mindtrip-path and mindtrip-prompt) |
Unpredictable β one overrides the other. | Split into two separate <form> elements, each with its own button. |
mindtrip-path on the flights page |
Non-fatal error appears in the slide-out panel. | Remove the path input. Flights handles its own routing automatically. |
Using a hash link (#mindtrip.ai/...) to navigate to a guide instead of mindtrip-path |
The guide opens but as an "Open Media Link" β the AI treats the URL as context to read, not a destination to navigate to. | Use mindtrip-path inside a form for guide navigation. Reserve hash links for opening entity detail pages. |
Calling showFrame() before the embed has loaded |
window.mindtrip is undefined error. |
The embed loads via defer, so it's ready by the time any user interaction fires. If you call it programmatically on load, wrap in setTimeout or wait for a mindtrip:ready event. |
Omitting the defer attribute on the script tag |
Script blocks page render; slower perceived load time. | Always use <script src="..." defer></script>. |
A minimal but fully functional page showing all four patterns together. Adapt the content, styles, and IDs for your destination.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Visit My Destination</title> <!-- Mindtrip embed β required on every page --> <script src="https://partner.mindtrip.ai/overlay/embed.js?orgid=your-org-id" defer></script> </head> <body> <!-- ββ PATTERN 1: Chat button with pre-filled question ββ --> <section> <h2>Plan your trip</h2> <form class="mindtrip-form"> <input type="hidden" class="mindtrip-prompt" value="Help me plan a trip to New York City."> <button id="homepage-hero-plan" class="mindtrip-button"> Start Planning </button> </form> </section> <!-- ββ PATTERN 2: Inline place link ββ --> <p> Don't miss <a href="#mindtrip.ai/location/new-york/united-states/at-5tEaBpEE?id=article-central-park"> Central Park </a> on a sunny afternoon. </p> <!-- ββ PATTERN 3: Navigate to an itinerary guide ββ --> <section> <h3>Featured Guide</h3> <form class="mindtrip-form"> <input type="hidden" class="mindtrip-path" value="/inspiration/city-guide-new-york-city-new-york/in-b3EoCdla"> <button id="itinerary-city-guide-view" class="mindtrip-button"> View Guide </button> </form> </section> <!-- ββ PATTERN 4: Trip planning form via JS API ββ --> <section> <h3>Build your itinerary</h3> <select id="field-duration"> <option value="">How long?</option> <option value="A weekend">Weekend</option> <option value="4β5 days">4β5 days</option> <option value="A week">A week</option> </select> <button type="button" onclick="launchPlanner()">Start Planning</button> </section> <script> function launchPlanner() { const duration = document.getElementById('field-duration').value; window.mindtrip.showFrame(null, { destination: 'New York City', prompt: 'Plan me a trip to New York City', hint: duration ? `Duration: ${duration}` : '', id: 'plan-form-submit' }); } </script> </body> </html>