Implement Adobe Target's at.js 2.0 in a Single Page Application (SPA)
The newest version of
at.jsprovides rich feature sets that equip your business to execute personalization on next-generation, client-side technologies. This new version is focused on upgrading
at.jsto have harmonious interactions with single page applications (SPAs).
How to Implement at.js 2.0 in a SPA
- Implementat.js2.0 in the <head> of your Single Page Application.
- Implement theadobe.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 thetriggerView()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 thetriggerView()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.js2.0 andtriggerView()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.js2.0 before upgrading:
- Cross domain tracking is not supported inat.js2.0
- The mboxOverride.browserIp and mboxSession URL parameters are not supported inat.js2.0
- The legacy functions mboxCreate, mboxDefine, mboxUpdate are deprecated inat.js2.0. Default content will be shown and no network requests will be made.