I am using DTM (and relatively new to it) and I have tried a number of approaches to automatically set the pageName variable to the document.title. I am trying to do as little custom code / js as possible and leverage the built in fields and features as much as possible. the closest I got was creating a data element. I was able to set an eVar to the data element just fine using the DTM fields and setting it to %variable%. But when I try to set the PageName field to the same thing, instead of passing the value of the variable, it gets set to the literal string "window.document.title".
when I tried to use the custom jscript field, and tried s.pageName = _satellite.getVar('varName'); I get a console error that object s is undefined.
What is the "best practice" for doing this with DTM?