For those not familiar with Google Tag Manager, here is how it works.
- Add a Google Tag Container to your website, (similar to how you add google analytics tracking code).
- Then add tracking code and tags to the tag container from the Tag Manager website.
- The tracking code and tags are then added to your website and you do not need to adjust any HTML, PHP or WordPress plugins on your site again. All tracking updates are done through the Tag Manager Website.
This system makes managing tags and tracking codes so much easier and more enjoyable. Once you get the hang of working with GTM, you will be much more likely to update and improve your tracking code.
This guide will walk you through the different methods for Adding Google Tags to your WordPress site. I have also included when it is the best use the methods and when to avoid using them.
Essentially you have three main options for adding the tag container to WP.
- Use a WordPress Plugin
- Use admin interface in WordPress template
- Use a text editor to add code directly to WordPress code