If you use ezwebin, or have it enabled at least, then you'll be able to use a template operator called ezpagedata_set and ezpagedata_append (to append values to arrays), these are abstractions for {set scope=global persistent_variable.. that should work on most pages.