A step by step guide with a Codepen demo.
https://blog.heyrory.com/google-analytics-4-google-tag-manager