Show Menu
TOPICS×

Implement Adobe Target's at.js 2.0 in a Single Page Application (SPA)

The newest version of at.js provides rich feature sets that equip your business to execute personalization on next-generation, client-side technologies. This new version is focused on upgrading at.js to have harmonious interactions with single page applications (SPAs).

How to Implement at.js 2.0 in a SPA

  • Implement at.js 2.0 in the <head> of your Single Page Application.
  • Implement the adobe.target.triggerView() function whenever view changes in your SPA. Various techniques can be employed to do this, such as listening for URL hash changes, listening for custom events fired by your SPA, or embedding the triggerView() code directly into your application. You should choose the option that works best for your specific single page application.
  • The view name is the first parameter of the triggerView() function. Use simple, clear, and unique names to make them easy to select in Target's visual experience composer.
  • You can trigger views in small view changes, as well as in non-SPA contexts such as half-way down an infinite scrolling page.
  • at.js 2.0 and triggerView() can be implemented via a tag management solution, such as Adobe Experience Platform Launch

at.js 2.0 Limitations

Please be aware of the following limitations of at.js 2.0 before upgrading:
  • Cross domain tracking is not supported in at.js 2.0
  • The mboxOverride.browserIp and mboxSession URL parameters are not supported in at.js 2.0
  • The legacy functions mboxCreate, mboxDefine, mboxUpdate are deprecated in at.js 2.0. Default content will be shown and no network requests will be made.