> For the complete documentation index, see [llms.txt](https://docs.relevant-digital.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.relevant-digital.com/technical/integration/formats-and-channels/set-up-google-oop-format.md).

# Set up Google OOP format

Use this pattern to define selected Google Ad Manager placements as out-of-page slots.

The callback replaces `googletag.defineSlot()` with `googletag.defineOutOfPageSlot()` for matching slots.

### Before you start

Add an identifying attribute to each slot that should use an out-of-page format. This example uses `data-dfp-oop`.

The implementation overrides the Google slot definition during `onBeforeAuctionSetup`.

{% hint style="info" %}
Use this pattern only with Google Ad Manager placements.
{% endhint %}

### Implementation

Register the callback before loading ads:

{% code title="out-of-page-slot.js" %}

```javascript
relevantDigital.addAuctionCallbacks({
    onBeforeAuctionSetup: ({ auction }) => {
        auction.googletagCalls = auction.googletagCalls || {};
        auction.googletagCalls.defineSlot = (adUnitPath, size, div) => {
            const element = document.getElementById(div);
            const format = element?.getAttribute('data-dfp-oop');

            if (format === 'outOfPage' || format === 'homepageOutOfPage') {
                return googletag.defineOutOfPageSlot(adUnitPath, div);
            }

            return googletag.defineSlot(adUnitPath, size, div);
        };
    },
});
```

{% endcode %}

### How it works

1. `onBeforeAuctionSetup` runs before the auction starts.
2. The callback overrides the auction’s `defineSlot` function.
3. The override reads `data-dfp-oop` from the slot element.
4. Matching values create an out-of-page slot. All other slots use the standard definition.

### Related API references

* [relevantDigital.addAuctionCallbacks()](/technical/integration/javascript-api/relevantdigital.addauctioncallbacks.md) — Register auction lifecycle callbacks.
* [relevantDigital.loadPrebid()](/technical/integration/javascript-api/relevantdigital.loadprebid.md) — Load and configure HB Manager auctions.


---

# 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.relevant-digital.com/technical/integration/formats-and-channels/set-up-google-oop-format.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.
