> For the complete documentation index, see [llms.txt](https://adagio-io.gitbook.io/adagio-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adagio-io.gitbook.io/adagio-documentation/operations-and-support/wrapper-integrity.md).

# Wrapper Integrity

Ensure your wrapper renaming configure doesn’t impact your monetization.

## **Overview**

Adagio’s viewability measurements and analytics data collection rely on Prebid.js’s wrapper. While it is possible to configure Prebid.js with a custom wrapper name, this must be done using the correct method to ensure compatibility.

{% hint style="danger" %}
Incorrectly renaming the wrapper can break key features, **including viewability measurement and analytics collecting.**
{% endhint %}

## **Problem**

Some clients attempt to rename the pbjs wrapper by replacing **all** occurrences of `pbjs` in the project code with a custom name (e.g., `myAliasPbjs`). However, this direct modification disrupts Adagio’s functionality because the system expects the wrapper to follow specific conventions internally (cf.: [adagioUtils.js](https://github.com/prebid/Prebid.js/blob/04ae8170d77fb19f56e18037a3d66a8906836555/libraries/adagioUtils/adagioUtils.js#L27C1-L28C1)).

For example:

* ✅ **Expected**: `window.ADAGIO.pbjsAdUnits`
* ❌ **Incorrect modification result**: `window.ADAGIO.myAliasPbjsAdUnits`

This incorrect renaming prevents Adagio from accessing the necessary data, causing viewability measurement and analytics collection to fail.

## **Correct Solution for Custom Wrapper Names**

If you wish to rename the wrapper, **do not modify the project code directly**. Instead:

1. Set your desired wrapper name through the `globalVarName` setting in the [**package.json**](https://github.com/prebid/Prebid.js/blob/master/package.json#L40) file (e.g., change it to `myAliasPbjs`).\
   ![](https://3602992756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4zBjf9CHegeJtXedq8Iv%2Fuploads%2Fv2OhxjqsAnhk0jWp9ZS8%2Fimage.png?alt=media\&token=b0756d0b-a463-415a-ac60-4a1fcc7d7213)
2. Rebuild the project to apply the new wrapper name correctly. This ensures that Adagio’s integration remains intact while allowing you to use a custom wrapper name.

## **Verification**

To confirm, run this command:

```javascript
// Should not return 'undefined'
window.ADAGIO.pbjsAdUnits
```

If it is an array, the wrapper is correctly configured.

By following these guidelines, you can configure a custom wrapper name in Prebid.js without impacting Adagio’s viewability and analytics features.


---

# 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://adagio-io.gitbook.io/adagio-documentation/operations-and-support/wrapper-integrity.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.
