> 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

Configure Google Ad Manager out-of-page slots through HB Manager auction callbacks.

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()](https://docs.relevant-digital.com/technical/integration/javascript-api/relevantdigital.addauctioncallbacks.md) — Register auction lifecycle callbacks.
* [relevantDigital.loadPrebid()](https://docs.relevant-digital.com/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 by asking a question.

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

```
GET https://docs.relevant-digital.com/technical/integration/formats-and-channels/set-up-google-oop-format.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.
