# JavaScript Embed

### Getting Started

For each integration, you need to create an embed code in your Caravan dealer account. \
Go to "[Tools > Inserate-Integration](https://www.caravan24.ch/chde/user/embed/)".

Each embed code consists of two lines of code containing a token:

{% code title="Caravan24 Embed Code" %}

```html
<div id="caravan24" data-token="..." data-language="de"></div>
<script src="https://embed.caravan24.ch/v1/loader.js"></script>
```

{% endcode %}

Simply copy and paste this code (including your embed token) and integrate it in the body of your website. The ads will be rendered automatically into the site.

### Changing the language

To change the language of the integration, simply set the language code in the data-language attribute.

{% code title="Language Code" %}

```html
<div id="caravan24" data-token="..." data-language="fr"></div>

```

{% endcode %}

#### Available languages

`de, fr`

### Page Header Offset

If a visitor clicks on an ad in your embed, the browser will focus on top of the detail view of the ad. If you have a large page header and you want to keep this page header visible, you can define a offset value in pixels:

{% code title="Offset Value" %}

```
<div id="caravan24" data-token="..." data-offset="150"></div>
```

{% endcode %}

With this offset value set, the detail view will open with x Pixels of the page header visible.
