> 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/sites-and-zones/dfi-mfi-html-events.md).

# Adding HTML Events for Fullpage Interstitials

The **Desktop Fullpage Interstitial** and **Mobile Fullpage Interstitial** ad formats can interact with your website through some HTML events. You can listen to these events to trigger additional actions in your website.

## creativeDisplayed

When a Fullpage Interstitial ad is loaded in the user's browser, it generates the event `creativeDisplayed-XXXXXXX`, where `XXXXXXX` is the zone id corresponding to that Fullpage Interstitial ad zone.

This event listener allows you to programmatically execute any action you may need on your website and get more information about the element that triggered the event, such as the URL, id, classes and text.

In the example below, we are displaying the `Creative shown!` message in Console when the Fullpage Interstitial is shown and we are listing all the details from the element that triggered the event:

```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">Visit exoclick.com!</a>

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

## message

If your Fullpage Interstitial ad zone serves an iframe campaign, then you can add an event listener to the event `message`. This allows you to programmatically execute any action you may need on your website after the iframe is loaded on user's browser.

The event data contains the properties `id`, which is an md5 of the iframe url parameter, and `loaded` being true. In the example below, we are displaying the `Iframe loaded!` message in Console when the Iframe is shown to the user's browser:

```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">Visit exoclick.com!</a>

<script type="application/javascript">
    window.addEventListener('message', function(event) {
        if (event.data.id && event.data.loaded) {
            console.log("Iframe loaded!")
        }
    });
</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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.exoclick.com/publishers/sites-and-zones/dfi-mfi-html-events.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
