Wrapper integrity
Overview
Section titled “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.
Problem
Section titled “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).
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
Section titled “Correct Solution for Custom Wrapper Names”If you wish to rename the wrapper, do not modify the project code directly. Instead:
- Set your desired wrapper name through the
globalVarNamesetting in the package.json file (e.g., change it tomyAliasPbjs).

- 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
Section titled “Verification”To confirm, run this command:
// Should not return 'undefined'window.ADAGIO.pbjsAdUnitsIf 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.