In this example, the teal body background is set by an offer fetched by target-global-mbox.
-
Details
The global mbox or "auto-created" global mbox is supported by at.js. A few considerations:
- The global mbox uses the new adobe.target.getOffer() + adobe.target.applyOffer() method instead of TNT.createGlobalMbox() or mboxCreate().
- The global mbox uses the "json" endpoint instead of the "standard" or "ajax" endpoints. Because of this Debugging is a little different.
- The global mbox is asynchronous so be careful with offers requiring synchronous functionality. (e.g. offers that set javascript variables that are used by code later on the page--it might not be there in time!)
- Both window.targetPageParams() and window.targetPageParamsAll() can be used to populate parameters in the auto-created global mbox.
- Flicker is controlled by pre-hiding the document and then revealing it on both success and error scenarios. Unlike the old synchronous, blocking global mbox of mbox.js, other assets will continue to load while the response is pending.
- The global mbox in at.js is controlled by the "Auto-create global mbox" toggle on the Setup->Implementation->Edit mbox.js settings screen of the new Target UI.
Note 1: targetPageParams(),targetPageParamsAll() should be defined before at.js script tag. e.g.
<html> <head> //styles & vital scripts ... <script> function targetPageParams(){ return ['page=' + document.location.pathname, 'src=targetPageParams']; } // and/or function targetPageParamsAll(){ return ['page=' + document.location.pathname, 'src=targetPageParamsAll'] } </script> ... <script src="at.js"></script> </head> <body> <!-- some content --> </body> </html>
Note 2: check console/network tab/Query String Parameters if page,src parameters are listed and have they values