As the title of guide indicates, so Installing Google Tag Manager in WordPress is not that Hard. I’ve already talked a lot about GTM in my previous article. So If you’ve not already created a GTM account or not managing your tags like GA tag, Advertising tags, etc. Then I suggest you to go for right away, because you can get a lot out of it.
In this guide I’m gonna show How you can Install Google Tag Manager in WordPress by 2 Easiest and Secured methods.
2 Ways to Install Google Tag Manager in WordPress:
There are 3 methods I mainly use to install GTM Script on my Clients WP Blog-site, of-course according to client’s need.
- Using a WP Plugin
- Using a Script Injector Plugin
- Editing the Themes Core files (header.php or footer.php).
But third one method is not recommended for you, because whenever you’ll update your WP Theme every-time that GTM code will be deleted and so you’ll need to place it again and again. And that’s why I don’t recommend you to Edit your WP Theme to place any Script tag or any code.
So, I’ll you exactly with screenshots that How to Install GTM Code in WordPress.
Installing GTM using a WP Plugin:
There are a lot of GTM plugins available there in the official WordPress Plugins repository. But I recommend you to go either for WP Google Tag Manager or for DuracellTomi’s Google Tag Manager for WordPress.
But right now I’m using DuracellTomi’s GTM plugin, so I’ll show you the installation using this plugin. Just follow the steps along with me:
- Search, Install and Activate the DuracellTomi’s GTM Plugin (for beginners- learn to install WP Plugins).
- Go to Settings > Google Tag Manager, and Enter your GTM container Tracking ID which looks something like GTM-XXXXXX.
Click Save Changes button and that’s all, you’re done. You can also get advanced data by setting things according to your needs in plugin settings. But for that all you might be needing to use and code variables and data-layers in Google Tag Manager while Creating a Tag.
Installing GTM using Script Injector:
As a Script Injector Plugin my favorite is Header and Footer Scripts by Anand Kumar. Follow along with me:
- Search, Install and Activate the plugin
- You can find its interface under your WP Dashboard’s Settings > Header and Footer Scripts.
To inject GTM Script you need to copy that Script code, you can do so by:
- Go to Google Tag Manager > Admin Tab, and then click Install Google Tag Manager button.
- Now Copy the Script Code and Paste it in the Scripts in Footer input box in your Header and Footer Scripts interface, as shown below:Don’t forget to click Save Settings.
And… You’ve successfully installed GTM in your WordPress Blog-site.
If you still have problem in Installing GTM then ask me via comments, very soon I’ll make you clear by performing a GTM Installation in a Video.
If this guide helped you, then please consider to share it with your friends on Social Networks like Facebook, Twitter and Google+.
Have a Good Day and Take Care.