Grab Your Free 17-Point WordPress Pre-Launch PDF Checklist:
Google Analytics by Yoast WordPress Plugin Configuration | WP Learning Lab
In this tutorial I show how to use the Google Analytics by Yoast plugin to add Google Analytics code to your website.
You can add the analytics code directly to the footer of your theme files as well, but then it will potentially be overwritten when the theme files update. You can create a child theme with a new footer.php file and put the analytics code in that way so it can’t be overwritten.
Unfortunately, there’s another problem. When you as the admin visit your website it registers as a visit in Google Analytics. If you have writers on your website that publish and update articles, each time the view an article it counts as visit. This inflates your Google Analytics data.
You can add filters to Google Analytics to register visits from certain IPs, but it’s not feasible to put everyone’s IP in there. What if one of your writers decides to work from a coffee shop today? What if you are traveling and access your website from a different country? You get the idea.
The best solution I’ve found is install a plugin called Google Analytics by Yoast which will remove the analytics code for signed in users. So if you’re serious about Google Analytics for WordPress you should use this plugin to make it happen.
So the first thing you’ll want to do is download an installing the Google Analytics plugin by Yoast.
To install this plugin please log into your WordPress dashboard, hover over Plugins and then click on Add New.
On the next page type “Google Analytics by Yoast” into the search bar. The plugin we want should be the first one in the top left.
Click on the Install Now button and then click Activate after it’s installed.
Now you’ll see a new menu option in the top left of your WordPress dashboard. When you click it you will have the option to automatically authenticate your analytics account or you can do it manually.
If you do it manually, by pasting UA- code into the field provided, you won’t be able to see analytics in the dashboard of your website.
Once you add your analytics code via any of the two methods above, select the user roles that should be ignored and you’re all set!
I hope this information helps you! If you have any questions leave a comment below or ping me @WPLearningLab on Twitter.
If you want more excellent WordPress information check out our website where we post WordPress tutorials daily.
Connect with us:
WP Learning Lab Channel: