The Google Tag Manager is great for quickly tagging things as events, adding GA tracking tags, AdWords, DoubleClick, custom HTML, and more. There are many integrations that are easily set up. There is somewhat of a learning curve with using GTM but at least you won’t have to worry about adding the two tag snippets in the correct places on your site. Continue reading to learn just how easy it is to implement the GTM tag onto your WordPress installation.
Log into the back end of your WordPress installation. Click on “Red Olive” in the left sidebar > General Tab > Google Tag Manager > Check the box to enable the tag > Paste in your GTM Tracking ID > Click Save Changes.
In your theme's header.php file add the following line:
<?php do_action( 'after_opening_body' ); ?>
immediately after the opening <body> tag.
NOTE: If your site uses a child theme, the header.php file may be found in the main theme directory or the child theme directory, or both. So, make sure to add the <?php do_action( 'after_opening_body' ); ?> code in any of the header.php files.
Via the WordPress Backend
In the back end of your WordPress site go here: Appearance > Editor > header.php and add the line right below the opening <body> tag.
***If WordPress will not allow you to edit this file you can install a theme editor plugin to make the change with a plugin like the following: https://wordpress.org/plugins/theme-editor/
Open the header.php file and add the line right below the opening <body> tag.
If you are unsure the of the name of your theme you can check it out in the WordPress back end by going to: Appearance > Themes > Find the Active Theme.
View the page source of your website and search for your GTM tag ID (you probably still have it copied to your clipboard) to verify that the tag is installed. You could also use the Google Chrome Tag Assistant Browser Extension to see if it’s installed properly on your site.
TRY RO MARKETING FREE
If you're not ready to buy one of our paid plugins try out RO Marketing Free.