> For the complete documentation index, see [llms.txt](https://docs.exads.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exads.com/publishers/sites-and-zones/dfi-mfi-html-events.md).

# Adding HTML Events for Fullpage Interstitials

As a Publisher, you can make the **Desktop Fullpage Interstitial** and **Mobile Fullpage Interstitial** ad formats interact with your website through HTML events. Use these events to trigger additional actions on your website.

## creativeDisplayed Event <a href="#creativedisplayed" id="creativedisplayed"></a>

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.

The example below displays the `Creative shown!` message in the console when the Fullpage Interstitial is shown, and lists all the details from the element that triggered the event:

{% code overflow="wrap" expandable="true" %}

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

<a href="https://www.example.com">Visit example.com!</a>

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

{% endcode %}

## message Event <a href="#message" id="message"></a>

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 in the user's browser.

The event data contains the properties `id`, which is an md5 of the iframe URL parameter, and `loaded` being true. The example below displays the `Iframe loaded!` message in the console when the iframe is shown in your visitor's browser:

{% code overflow="wrap" expandable="true" %}

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

<a href="https://www.example.com">Visit example.com!</a>

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

{% endcode %}


---

# 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.exads.com/publishers/sites-and-zones/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.
