mbox.js Implementation

To use Target Standard or Target Premium, add one line of code to call mbox.js.

You can use either of two library references: mbox.js or at.js. Understanding the Target JavaScript Libraries explains the differences between the two libraries.

Note: The mbox.js library is no longer being developed. All customers should migrate from mbox.js to at.js. For more information, see Migrate to at.js from mbox.js.

The single reference to mbox.js on each page provides the libraries needed for all of your activities. mbox.js calls Target from every page that references the mbox.js file. This enables Target to do the following:

  • Deliver Target activities
  • Track clicks
  • Track most success metrics
Tip: To simplify implementation, you could reference mbox.js in your global header.

This video explains how to implement mbox.js.

mbox.js Implementation Overview 8:52

  • Select the correct settings for your mbox.js file
  • Implement Target by adding the mbox.js file to the <head> of your site

You do not need to maintain different activity-specific versions of the file.

Reference mbox.js in the <head> section of each page on your site.

<script src="/directory/scripts/mbox.js"></script>

Where directory/scripts is the directory where you saved your mbox.js file after downloading it.

If you already have mboxes on your page from a former Target Classic 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.