Making decisions that are compelled by data, rather than intuition, makes big websites stay on top. To make data-driven decisions, webmasters need some kind of analytics tool. Though there are several of those out there, it is highly unlikely that you will need anything more than Google Analytics.
This free tool enables you to see the strong sides of your website and help you improve them further; but, what is more important, it will help with pinpointing any weak points. With Google Analytics, you can see who is visiting your website, their location, the device they are using, how long they are staying on your website, how many pages they visit in a single session, and a great deal of other metrics. So, how do we get Google Analytics to work on a WordPress-powered website?
Adding Google Analytics with plugins
There is no secret behind the stellar success of WordPress, it is simple to setup and easy to maintain. One of the most important ingredients of its success are plugins. Plugins are special add-ons that improve the overall functionality of WordPress. Today, there are over 40,000 available plugins for this platform.
Among those 40K plugins, there are more than a dozen that help you implement the Google Analytics tracking code, and some even add GUI in the WordPress dashboard that lets you see the summary data without the need of visiting google.com/analytics.
Prior to installing any plugins, you will have to register an account with Google Analytics and get your tracking code. Once that is done, save the tracking code and login into your website’s dashboard.
Navigate to plugins and click on add new.
Search for analytics and choose any of the available plugins (this is left to your preference). For the purposes of this article, we installed the Monster Insights plugin. Once you activate it, navigate to its menu and click authenticate with Google.
It will take time for GA to get a scope of your traffic, but when it does, you’ll be able to monitor that traffic through the plugin page in your website dashboard or on the Google Analytics page.
Adding Google Analytics by foot
We don’t want to dispute the usefulness of WordPress plugins, but while they are WP’s strong side, at the same time they are its weakness. One plugin too many and your website will see a massive decrease in loading speed and ultimately decline in visits. The reason this might happen is that users bounce off of websites that take more than 3 seconds to load. In case you already have a high number of plugins installed in your theme, it is best you implement the code by hand.
Copy that piece of code into your clipboard and login to your website dashboard. Navigate to Appearance > Editor. Once there, you will see the back-end of your website. In the righthand side of that window is the list of all the files that are used to power your website. In that list, you need to find the file labeled as header.php. Open that file and paste your code just above the closing tag - .
This can also be achieved by editing the functions.php file. Find it the same way you found the header.php and add this:
Bear in mind that in case you don’t use a child theme on your website, the code will be deleted every time the theme updates along with other customizations you might have done. That is why having a child theme is recommended.
Google analytics is an essential tool for every webmaster, and if you haven’t already got it on your website, make sure you implement it as soon as possible. In case your website already has too many plugins and you don’t feel comfortable meddling with the website’s code on your own, it is best to turn to a professional web designer in Sydney for help.