It's easy to add GTM to your WordPress site. Just follow these steps.
From the Google Tag Manager (GTM) website, navigate to Admin > Setup Google Tag Manager, copy the first code (head) using the icon on the right.
Then, go to your WordPress admin. Navigate to SEO > Analytics > Custom Tracking tab, and paste your code into the field “[HEAD] Add an additional tracking code (like GTM, Facebook Pixel, Hotjar…)“.
Go back to GTM, copy the second part (body), and paste it into the field “[BODY] Add an additional tracking code (like Google Tag Manager…)“.
Save changes.
Clear your cache.
Done!