# Book a tour

Source: https://help.ruuster.com/idx/recipe-tour-booking

> The listing page's tour screen, from RequestTourModal, with a 16-day picker, morning, afternoon and evening times, the visitor's details with consent, and the request your route receives.

"Choose tour time" on a listing page opens the tour screen. The visitor picks a day from the next 16
days and a time of day, then gives their name, phone and email with your consent wording, and sends
the request. The last step confirms what they asked for. The request goes to your own server route,
which sends it to your CRM, so your agent can confirm the tour. `ListingDetail` mounts the tour
screen for you when you pass `leadAction` and `consentText`.

## What the visitor sees

<figure class="idx-shot"><img src="/idx-docs/screens/ours/tour-modal-1440.png" alt="The tour dialog, closed, on its date step, with the contact step and the summary hidden, on a desktop (1440 px wide)" width="1440" height="900" loading="lazy" decoding="async"><figcaption>Step 1: the day and the time of day.</figcaption></figure>

<figure class="idx-shot"><img src="/idx-docs/screens/ours/tour-modal-375.png" alt="The tour dialog, closed, on its date step, with the contact step and the summary hidden, on a phone (375 px wide)" width="375" height="812" loading="lazy" decoding="async"><figcaption>Step 1: the day and the time of day.</figcaption></figure>

The markup is `static/html/tour-modal.html` in `@ruuster/idx-recipes`. The [HTML and CSS recipe](https://help.ruuster.com/idx/recipe-html-css) shows how to fill it and which stylesheet and script to load.

<figure class="idx-shot"><img src="/idx-docs/screens/ours/tour-modal-info-1440.png" alt="The tour dialog after Next: the date step is hidden and the contact form shows, with the picked day and time in its hidden inputs, on a desktop (1440 px wide)" width="1440" height="900" loading="lazy" decoding="async"><figcaption>Step 2: how to reach the visitor.</figcaption></figure>

<figure class="idx-shot"><img src="/idx-docs/screens/ours/tour-modal-info-375.png" alt="The tour dialog after Next: the date step is hidden and the contact form shows, with the picked day and time in its hidden inputs, on a phone (375 px wide)" width="375" height="812" loading="lazy" decoding="async"><figcaption>Step 2: how to reach the visitor.</figcaption></figure>

The markup is `static/html/tour-modal-info.html` in `@ruuster/idx-recipes`. The [HTML and CSS recipe](https://help.ruuster.com/idx/recipe-html-css) shows how to fill it and which stylesheet and script to load.

<figure class="idx-shot"><img src="/idx-docs/screens/ours/tour-modal-sent-1440.png" alt="The tour dialog after the request was sent: the summary shows the day, the time, the phone and the email, on a desktop (1440 px wide)" width="1440" height="900" loading="lazy" decoding="async"><figcaption>Step 3: the request is sent.</figcaption></figure>

<figure class="idx-shot"><img src="/idx-docs/screens/ours/tour-modal-sent-375.png" alt="The tour dialog after the request was sent: the summary shows the day, the time, the phone and the email, on a phone (375 px wide)" width="375" height="812" loading="lazy" decoding="async"><figcaption>Step 3: the request is sent.</figcaption></figure>

The markup is `static/html/tour-modal-sent.html` in `@ruuster/idx-recipes`. The [HTML and CSS recipe](https://help.ruuster.com/idx/recipe-html-css) shows how to fill it and which stylesheet and script to load.

## How it opens

Every button that opens it carries `data-rw-open="tour"`:

- the accent "Choose tour time" button in the sidebar's tour card, from 992 pixels;
- the same button in the action bar fixed to the bottom of the screen, under 992 pixels;
- "Schedule a tour" under the open houses;
- the same buttons in the full gallery's sidebar and mobile bar.

## The steps

1. **The day and the time.** "Choose a time that works for you." over a small card of the home (its
   first photo, price, facts and address). Below it:
   - **Days**: 16 days starting today in the listing's time zone, 7 at a time, each showing the
     weekday, the date and the month. The arrows move between the pages of days and turn off at
     either end.
   - **Time of day**: "Any time", "Morning (8 AM to 12 PM)", "Afternoon (12 PM to 4 PM)" and
     "Evening (4 PM to 8 PM)". The visitor can pick more than one. "Any time" clears the others, and
     picking all three becomes "Any time". For today, a time of day that has ended is turned off, and
     "Any time" is turned off once all three have.
   - **Next** stays off until a day and a time are picked, with a line that says which is missing.
2. **How to reach the visitor.** "How can we reach you?" with Name (first and last name), phone and
   email, your consent wording beside an unchecked box, and the optional listing-alerts box. "Back"
   returns to the days with the choices kept. "Request a tour" sends the request.
3. **Received.** "Tour request received" and a summary card: the tour date ("Thursday, November 12"),
   the time, the phone (written as 404-555-0187 for a 10-digit US number) and the email. "Done"
   closes the screen and starts the next visitor at step 1.

When your route answers anything but a 2xx status, step 2 shows "We could not send your tour request.
Please check your connection and try again." and keeps what the visitor typed.

The listing's time zone comes from its first open house that names one, and otherwise from the
visitor's device. The day list fills in on the visitor's device, so it always starts from their today.

## What your route receives

"Request a tour" posts one `LeadSubmission` as JSON to `leadAction`:

```json
{
  "kind": "tour",
  "firstName": "Sam",
  "lastName": "Rivera",
  "email": "sam.rivera@example.com",
  "phone": "4045550187",
  "message": null,
  "tour": { "date": "2026-11-12", "time": "afternoon" },
  "listing": { "id": "aaaaaaaa-0000-4000-8000-000000000001", "mlsNumber": "FXSTD100", "url": "https://www.peachrealty.example/homes/123-peachtree-st-ne-atlanta-ga-30308-aaaaaaaa-0000-4000-8000-000000000001" },
  "consent": { "contact": true, "alerts": false, "text": "I agree that Peach Realty may contact me by phone, text or email about this request." },
  "page": { "url": "https://www.peachrealty.example/homes/123-peachtree-st-ne-atlanta-ga-30308-aaaaaaaa-0000-4000-8000-000000000001", "referrer": null },
  "attribution": { "utmSource": null, "utmMedium": null, "utmCampaign": null, "utmTerm": null, "utmContent": null, "gclid": null, "fbclid": null }
}
```

- `tour.date` is the picked day as `YYYY-MM-DD`.
- `tour.time` is the picked times of day joined by a comma and a space, from these values:

  | Value | The visitor picked |
  |---|---|
  | `anytime` | Any time |
  | `morning` | Morning, 8 AM to 12 PM |
  | `afternoon` | Afternoon, 12 PM to 4 PM |
  | `evening` | Evening, 4 PM to 8 PM |

  Two picks read `morning, afternoon`. All three are sent as `anytime`.
- `firstName` and `lastName` come from the Name field: the first word, then the rest. The field
  asks for at least two words.

After a 2xx answer the page sends the GA4 `generate_lead` event. The CRM senders in `@ruuster/idx/crm`
write the request into the lead's note as "Requested a tour: 2026-11-12, afternoon." See
[Send leads and activity to your CRM](https://help.ruuster.com/idx/crm-overview).

## Use it on your own layout

Mount `RequestTourModal` once inside the element that carries `data-rw-detail`, and put
`data-rw-open="tour"` on your own button in that element. The
[gallery page](https://help.ruuster.com/idx/recipe-gallery) shows a full layout.

| Prop | Type | Required | What it does |
|---|---|---|---|
| `listing` | `ListingDetail` or `ListingCard` | Yes | The home to tour, for the card and the request |
| `action` | `string` | Yes | Your route, for example `/api/leads/fub` |
| `consentText` | `ReactNode` | Yes | Your consent wording beside the unchecked contact box |
| `alertsConsentText` | `ReactNode` | No | Your wording for the separate listing-alerts box |
| `now` | `Date` | No | The time the days are counted from. Leave it out on a live site |

The inline `TourForm` from [Registration, tour and contact forms](https://help.ruuster.com/idx/recipe-forms)
sends the same request from a form on the page itself, for layouts that keep the form in view.

## Rules this screen follows

**MUST**

- Keep both consent boxes unchecked until the visitor checks them, and send the exact wording.
- Confirm every tour with the visitor yourself. The request asks for a time; your agent sets it.
- Post to your own server route, which sends the lead to your CRM.

**NEVER**

- Send the lead to a CRM from the browser, or put a CRM key in browser code.
- Ask for details beyond the name, phone and email the request needs.
