> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/advertisers/de/kampagnen/iframe-events.md).

# Iframe-Ereignisse

Werbetreibende können Ereignisse in ihren Anzeigen verfolgen. Diese Ereignisse werden mithilfe von JavaScript programmgesteuert direkt im Browser des Clients verwaltet.

## Ereignisse

### creativeDisplayed

{% hint style="info" %}
Dies ist nur verfügbar für **Desktop-Vollseiten-Interstitial** und **Mobile-Vollseiten-Interstitial** (*DFPI/MFPI*) Ad-Format-Kampagnen mit **iframe-URL** Variante.
{% endhint %}

Wenn die Anzeige dem Nutzer angezeigt wird, wird eine Nachricht an das iframe mit dem Namen gesendet `creativeDisplayed`.

Sie können dieses Ereignis in Ihrem iframe mit dem folgenden Skript verfolgen, das einen Event-Listener hinzufügt, um die gesendete Nachricht abzufangen, sobald die Anzeige dem Nutzer angezeigt wird.

```html
<script>
        function readMessage(event) {
            console.log("readMessage-Ereignis");
            console.log("Ursprung: " + event.origin);
            console.log("Daten: " + event.data);
        }

        if (window.addEventListener) {
            // Für standardkonforme Webbrowser
            window.addEventListener("message", readMessage, false);
        } else {
            window.attachEvent("onmessage", readMessage);
        }
</script>
```

## Beispiel - Vollseiten-Interstitial

```html
<!DOCTYPE html>
<html>
<head>
    <!-- EREIGNISTEIL -->
    <script>
        function readMessage(event) {
            console.log("readMessage-Ereignis");
            console.log("Ursprung: " + event.origin);
            console.log("Daten: " + event.data);
            var message = "Wir haben die Nachricht erhalten: '" + event.data + "' von '" + event.origin + "' (wir befinden uns jetzt im iframe des Werbetreibenden)";
            console.log(message);
            document.getElementById("received-message").innerHTML = message;
            // Der Werbetreibende möchte ein Element aktualisieren
        }
        if (window.addEventListener) {
            // Für standardkonforme Webbrowser
            window.addEventListener("message", readMessage, false);
        } else {
            window.attachEvent("onmessage", readMessage);
        }
    </script>
    <!-- ENDE DES EREIGNISTEILS -->
</head>
<body>
    <h1>Meine Test-iframe-Überschrift</h1>
    <p>Mein Test-iframe-Absatz</p>
    <p id="received-message">Warten auf die Nachricht</p>
</body>
</html>
```

<figure><img src="/files/7b8116f0a17343bbc9e2b44ed268ef32c5227166" alt=""><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.exoclick.com/advertisers/de/kampagnen/iframe-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
