# Vehicle Search

This section documents all JavaScript custom events dispatched by the Carposé Car Search component. These events allow integration with analytics tools, marketing platforms, or custom logic. Carposé itself does **not** track user behavior; manual implementation is required.

### Car Selected Event <a href="#car-selected-event" id="car-selected-event"></a>

Dispatched when a user clicks on a car card to view details.

**Event Name**: `carpose-car-select`

**Event Data**:

```json
{
  message: "Car select",
  type: "car",
  data: {
    id: "car-456",
    name: "Renault 4 E-Tech elektrisch Evolution 120 Urban Range",
    offerNumber: "OF123456",
    manufacturer: "Renault",
    model: "4 E-Tech"
  }
}
```

**How to Listen**:

```javascript
document.body.addEventListener('carpose-car-select', function(event) {
  const carData = event.detail.data;

  console.log('User selected car:', carData.name);
  console.log('Manufacturer:', carData.manufacturer);
});
```

### Car Contact Modal Open Event <a href="#car-contact-modal-open-event" id="car-contact-modal-open-event"></a>

Dispatched when a user opens the contact modal for a car.

**Event Name**: `carpose-car-contact-modal-open`

**Event Data**:

```json
{
  message: "Car contact modal open",
  type: "car",
  data: {
    id: "car-456",
    name: "Renault 4 E-Tech elektrisch Evolution 120 Urban Range",
    offerNumber: "OF123456",
    manufacturer: "Renault",
    model: "4 E-Tech"
  }
}
```

**How to Listen**:

```javascript
document.body.addEventListener('carpose-car-contact-modal-open', function(event) {
  const carData = event.detail.data;

  console.log('Contact modal opened for car:', carData.name);
});
```

### Car Contact Event <a href="#car-contact-event" id="car-contact-event"></a>

Dispatched when a user successfully submits a contact form for a car.

**Event Name**: `carpose-car-contact`

**Event Data**:

```json
{
  message: "Car contact",
  type: "car",
  data: {
    id: "car-456",
    name: "Renault 4 E-Tech elektrisch Evolution 120 Urban Range",
    offerNumber: "OF123456",
    manufacturer: "Renault",
    model: "4 E-Tech"
  }
}
```

**How to Listen**:

```javascript
document.body.addEventListener('carpose-car-contact', function(event) {
  const carData = event.detail.data;

  console.log('Contact form submitted for car:', carData.name);
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.carpose.de/events/vehicle-search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
