There are a number of ways to set s.pageName for each page, In DTM, the conditions for your rules answer questions like: What’s the visitor doing? Where are they doing it? When is it happening? You can set any number of variables, trigger different tags or tools, and execute any number of scripts from within the same rule, as long as you want all those things to happen in response to the same conditions.
For example, if you want document.title to be the source for the value of the s.pageName variable, you could create a Data Element with a name of Page Name, a Type of JS Object, a Path of document.title, a Default Value of None, and Remember this value for Pageview.
Then, you could create a global Page Load rule and assign that Data Element to s.pageName, either in the interface, or in the Custom Editor code window. It will then be dynamically populated with the value of document.title for each page that meets your conditions.