> For the complete documentation index, see [llms.txt](https://audalaxy.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://audalaxy.gitbook.io/docs/json-configurations-for-adtech/json-configurations-for-adtech.md).

# JSON Configurations for AdTech

The following options and configurations are available for optimizing audio advertising.

> **Note:** You can find the complete JSON schema with all Advanced Settings [here](/docs/json-configuration-guide-advanced-settings/json-configuration-guide-for-advanced-settings.md).

## Opener and closer - instream / midroll

Configure opener and closer of instream ads.

**Supported format**: mp3, wav

```json
{
  "ad_instream_opener": [
      "https://streamabc-audio-content.s3.eu-central-1.amazonaws.com/testfiles/563935__fester993__guitar-trombone-reverb.wav"
  ],
  "ad_instream_closer": [
      "https://streamabc-audio-content.s3.eu-central-1.amazonaws.com/testfiles/564003__rasmuspnielsen__low-hum-32-hz.wav",
      "https://streamabc-audio-content.s3.eu-central-1.amazonaws.com/testfiles/564309__keybal__thermal-sniper-shot-3.wav",
      "https://streamabc-audio-content.s3.eu-central-1.amazonaws.com/testfiles/563850__nikplaymostories__fail-trombone-wah-wah-wah-sound-effect.mp3"
  ]
}
```

## Opener - preroll

Configure opener for preroll.

**Supported format:** mp3, wav

Set <mark style="color:red;">`ad_force_preroll_opener`</mark> to <mark style="color:red;">`true`</mark> if the opener should always be included, e.g. in the case of sponsored channels, the opener is always inserted at the start of the session.

```json
{
  "ad_preroll_opener": [
      "https://streamabc-audio-content.s3.eu-central-1.amazonaws.com/testfiles/563935__fester993__guitar-trombone-reverb.wav"
  ],
  "ad_force_preroll_opener": "true"
}
```

## Closer - preroll

Configure closer for preroll.

**Supported format:** mp3, wav

```json
{
  "ad_preroll_closer": [
      "https://streamabc-audio-content.s3.eu-central-1.amazonaws.com/testfiles/563935__fester993__guitar-trombone-reverb.wav"
  ],

}
```

## Grace time

The grace time, in seconds, is the time during the Audalaxy Streamer service should ignore ad triggers. This timer starts immediately after an ad trigger with a successful impression.

**grace\_time**

grace time between midrolls

**grace\_time\_preroll**

grace time from preroll to first midroll

**grace\_time\_reconnect**

grace time between prerolls in case of reconnect

```json
{
    "grace_time": 600,
    "grace_time_preroll": 900,
    "grace_time_reconnect": 30
}
```

## Disable Preroll Ads

Preroll spots for an active session can be suppressed using the URL query parameter context with value fHA6LTE= (AIS default parameter): <http://streamurl/?context=fHA6LTE=>

Further configuration for ads like ad duration, number of ads as well as disabling ads in general can be done using tokens (JWT). This is the preferred way for the most flexibility but needs more work to implement on the client side.

## Disable All Ads

Using a special advanced configuration it is possible to disable all ads for a specific session.

```json
{
    "no_ad_parameter": "noads"
}
```

This configured parameter has to be passed as value of the URL query parameter context. For the example above this would lead to: <http://streamurl/?context=noads>

Keep in mind that everyone that knows this value can suppress ads in your stream. So it is recommended to use this parameter for specific purposes only. It can be changed on the fly if the value is misused or leaked.

For a more secure way to do this it is also possible to use tokens (JWT). Tokens have a limited lifetime and can not be used for multiple sessions.

## Max. ad duration per session

The max. ad duration per session, in seconds, indicates the maximum offset that the listener may have in the session. This could be necessary, for example, if the listener listens to the channel all day.

```json
{
    "ad_duration_max": 900
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://audalaxy.gitbook.io/docs/json-configurations-for-adtech/json-configurations-for-adtech.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.
