Skip to content

Wrapper Integrity

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.

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.

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 file (e.g., change it to myAliasPbjs).
  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.

To confirm, run this command:

// 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.