Skip to content

Instantly share code, notes, and snippets.

@otarsko
Created December 4, 2019 15:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Adobe Experience Cloud without AEM | Triggering Adobe Target SPA view
exports.onRouteUpdate = ({ location, prevLocation }) => {
let viewName = location.pathname.substr(1, location.pathname.length - 2) || "home";
if (typeof adobe != 'undefined' && adobe.target && typeof adobe.target.triggerView === 'function') {
adobe.target.triggerView(viewName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment