We use a singular code base across the site, rather than static tagging. Generally, we use Processing rules to help manage some exception handling. the 404Error page is one such exception
In debugger, regardless of the bad URL, the page title is "page not found"
with s.pagetype available in Processing rules, we could create
IF Page Title is "page not found".
Overwrite value of s.pagetype="errorPage"