Created
August 28, 2018 15:02
-
-
Save ryanpraski/6b7e17c0ff3e1300fcab96482db7abf9 to your computer and use it in GitHub Desktop.
If you want to save the previous pageName via DTM without a Plugin (getPreviousValue), you can use Session Storage. Two Pageload Rules are needed.
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
[Adobe Analytics|DTM] Previous pageName | |
If you want to save the previous pageName via DTM without a Plugin (getPreviousValue), you can use Session Storage. Two Pageload Rules are needed. | |
First PLR: | |
- Trigger Rule at “DOM Ready” | |
- Rule Condition: Path “.*” (regex enabled) | |
- Custom Code “None-Sequential Javascript”: | |
if(typeof(Storage) != "undefined") { | |
if (typeof(s) !== "undefined") { | |
sessionStorage.pagename = s.pageName; | |
} | |
} | |
Second PLR: | |
- Trigger Rule at “Bottom of Page” | |
- Rule Condition: Path “.*” (regex enabled) | |
- Rule Condition: Custom: | |
if(typeof(Storage) !== "undefined") { | |
if(typeof(sessionStorage.getItem("pagename")) != "undefined") { | |
var prevPageName = sessionStorage.getItem("pagename"); | |
_satellite.setVar("previousPage",prevPageName); | |
return true; | |
} | |
} | |
- Adobe Analytics: prop2 set as %previousPage% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://apastebin.tumblr.com/post/139627646180/adobe-analytics-dtm-previous-pagename