Created
December 4, 2019 15:35
-
-
Save otarsko/4f7eeba627e3d6f1e434fc187883cfcc to your computer and use it in GitHub Desktop.
Adobe Experience Cloud without AEM | Triggering Adobe Target SPA view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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