Free tool
GTM dataLayer Builder
Build a dataLayer.push() visually. Add keys, pick a type, nest objects and arrays — the script writes itself on the right.
Start from
Quotes
Keys and values
Generated code