There are basically two parts to this.
First, setting the cookie: If you use 5 persist data value extensions, each will overwrite the value of the previous one. What you need to do is build a string in a variable using the Set Data Values extension, and then pass that variable to the cookie.
If you use a set data values extension to set a UDO variable to "JS Code" containing
"value1:"+utag.data['value1']+"%24" + "value2:"+utag.data['value2']
and keep going adding your keys in quotes, then a plus, then the utag.data variable (or other data) that you want to add to that key, then another plus, then "%24" which is the URI encoded version of $ (used as a separator)
Once you have set that up, create a Persist Data Values extension, and make sure you call the cookie "utag_xxxx" where xxxx is whatever you want to name it.
The utag_ prefix will mean that when the cookie is read back, it will automatically be read back into the data layer as it's individual components, so cp.utag_xxxx_value1, cp.utag_xxxx_value2 etc.
I hope that helps
Connecting data systems since the 1980s.