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.

triangle-exclamation

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.jsarrow-up-right).

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.jsonarrow-up-right 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.

Verification

To confirm, run this command:

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.

Last updated

Was this helpful?