> 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/publishers/es/sitios-y-zonas/dfi-mfi-html-events.md).

# Añadir eventos HTML para intersticiales de página completa

El **Interstitial de página completa para escritorio** y **Interstitial de página completa móvil** los formatos de anuncios pueden interactuar con tu sitio web a través de algunos eventos HTML. Puedes escuchar estos eventos para desencadenar acciones adicionales en tu sitio web.

## creativeDisplayed

Cuando un anuncio intersticial de página completa se carga en el navegador del usuario, genera el evento `creativeDisplayed-XXXXXXX`, donde `XXXXXXX` es el id de zona correspondiente a esa zona de anuncio intersticial de página completa.

Este detector de eventos te permite ejecutar programáticamente cualquier acción que necesites en tu sitio web y obtener más información sobre el elemento que desencadenó el evento, como la URL, el id, las clases y el texto.

En el ejemplo siguiente, estamos mostrando el `¡Creativo mostrado!` mensaje en la consola cuando se muestra el intersticial de página completa y estamos enumerando todos los detalles del elemento que desencadenó el evento:

```js
<script async type="application/javascript" src="https://a.pemsrv.com/ad-provider.js"></script>
<ins class="eas6a97888e35" data-zoneid="1234567"></ins>
<script>(AdProvider = window.AdProvider || []).push({"serve": {}});</script>

<a href="https://www.exoclick.com">¡Visita exoclick.com!</a>

<script type="application/javascript">
    document.addEventListener('creativeDisplayed-1234567', function (e) {
        console.log("¡Creativo mostrado!");
        console.log(e.detail);
    }, false);
</script>
```

## mensaje

Si tu zona de anuncio intersticial de página completa sirve una campaña iframe, entonces puedes añadir un detector de eventos al evento `mensaje`. Esto te permite ejecutar programáticamente cualquier acción que necesites en tu sitio web después de que el iframe se haya cargado en el navegador del usuario.

Los datos del evento contienen las propiedades `id`, que es un md5 del parámetro de URL del iframe, y `cargado` siendo true. En el ejemplo siguiente, estamos mostrando el `¡Iframe cargado!` mensaje en la consola cuando se muestra el iframe en el navegador del usuario:

```js
<script async type="application/javascript" src="https://a.pemsrv.com/ad-provider.js"></script>
<ins class="eas6a97888e35" data-zoneid="1234567"></ins>
<script>(AdProvider = window.AdProvider || []).push({"serve": {}});</script>

<a href="https://www.exoclick.com">¡Visita exoclick.com!</a>

<script type="application/javascript">
    window.addEventListener('message', function(event) {
        if (event.data.id && event.data.loaded) {
            console.log("¡Iframe cargado!")
        }
    });
</script>
```


---

# 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/publishers/es/sitios-y-zonas/dfi-mfi-html-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.
