I have been doing mostly marketing for a few years and looks like editing header.php is not really an option anymore? What is the best true way? Without unnecessary plugins if possible.
Copyright © 2020 - 2022, Project DMC - WordPress Tutorials for Beginners- All Rights Reserved. Privacy Policy
I understand you’re looking for a plugin free option… but in case that doesn’t work out, Google do offer an official [Site Kit](https://www.google.com/amp/s/sitekit.withgoogle.com/) plugin that makes it super easy.
[deleted]
Any good SEO extension should do it for you. I like RankMath best myself, but there are plenty to choose from. They will also do other useful stuff too. I know you said without plugins, but you get so much benefit from a good SEO plugin, it’s well worth adding.
While SEO plugins can do the job for you, I would go with Sitekit. It’s the official app from Google, and it has a nice dashboard to show you the performance. It also allows you to connect GTM container, and I haven’t confirmed it, but pretty sure it will prevent you from having double entries.
that’s the easiest way to go with no code.
If you don’t want an additional plugin create a child theme and create a function to add the GTM jS container to the head.
However I would recommend you look at GTM4WP plugin which has a very rich data layer and super helpful features.