Migrate from mbox.js to at.js
The at.js library is a new implementation library for Adobe Target designed for both typical web implementations and single-page applications.
Among other benefits, at.js improves page-load times for web implementations and provides better implementation options for single-page applications.
at.js replaces mbox.js for Target implementations. The at.js library also includes the components that were included in target.js, so there is no longer a call to target.js.
Benefits of at.js
The following table explains the differences between the two libraries: 4 | Library Reference | Description | |--- |--- | |at.js|at.js replaces mbox.js for Target implementations.
Among other benefits, at.js improves page-load times for web implementations, improves security, prevents document.write warnings in Google Chrome, and provides better implementation options for single-page applications.
For more information, see at.js Implementation .| |mbox.js|Prior to Target 16.3.1 (March 2016), Target required a call to mbox.js to create the global mbox required for Target to deliver activities, track clicks, and track most success metrics. This file contains the libraries needed for all of your activities. You do not need to maintain different activity-specific versions of the file.
If you already have wrapping mboxes on your pages from an older style of Target implementation, these mboxes can still be used in the new interface. The updated mbox.js file is still required, but these mboxes can be selected for activities and edited using the Visual Experience Composer.
Target Standard and Premium update and supplement mbox.js with a reference to a target.js file. The target.js file is hosted by Adobe. The Target.js file makes it possible to edit content on any page using the Visual Experience Composer, even if the page does not contain predefined mboxes. You must reference this file on every page on your site.
For more information, see mbox.js Implementation .
Important : The mbox.js library is still supported, but there will be no feature updates. All customers should migrate to at.js. For more information, see Migrate to at.js from mbox.js
To use at.js, replace the mbox.js reference on pages where you want to implement it. You cannot use both mbox.js and at.js on a single page. However, you can use either on each page on your site.
The at.js library works for existing implementations using the mboxCreate() , mboxDefine() , and mboxUpdate() functions and supports new functionality focused on single-page-app based implementations.
You can use at.js anywhere you currently use mbox.js.
The at.js library offers several improvements over the mbox.js library, including:
- Completely asynchronous communication via cross domain AJAXAlthough at.js communicates with the Target servers asynchronously, the at.js file itself must load synchronously in the <head> section of your page. Ideally, it should be one of the first scripts loaded. Once loaded, at.js executes mbox calls asynchronously through XMLHttpRequest , and does not block page rendering.
- No more blocking calls
- No document.write() used
- Better timeout and error handling
- Customizable timeout per call
- No reloads on timeouts
- Functions designed specifically for single-page apps/MVC frameworks
Training video: at.js - Advantages and Implementation Best Practices
This video is a recording of " Office Hours ," an initiative led by the Adobe Customer Care team.
- How the at.js library works
- The advantages of at.js over mbox.js
- How at.js manages flicker
- Error handling in at.js
- Debugging methodologies
- Known issues and future roadmap