Top 3 Ways to Add Google Analytics to WordPress
Looking to setup Google Analytics 4 (GA4) on your WordPress website? As you may have already noticed, there’s definitely more than one way to do so. This quick guide can help you decide which is the best method for you! Let’s dive into the top 3 ways to add Google Analytics 4 to a WordPress website:
If you read my other article on how to setup Google Analytics 4 for WordPress then you already know this is my preferred method. Begin by installing the WPCode Lite plugin. Next go to the admin setting in Google Analytics and click Data Streams and then select your primary data stream. From here click View tag instructions at the bottom of the screen. Copy your tracking code from the Google Analytics installation instructions page to the header section of WPCode tab in WordPress. Save changes and lastly you should test your implementation (by clicking test on the installation instructions page). Note that it may take 24-48 hours for data to begin showing up.
All you need to do to setup Google Analytics 4 using MonsterInsights is install the plugin and complete the setup wizard. Completing the setup wizard will connect MonsterInsights will implement your tracking code for you. Check out Google’s guide on using MonsterInsights for helpful gifs demonstrating the process.
I think the only reason I’m personally not a fan of MonsterInsights is that you have to pay for dashboards that are available for free in Google Analytics 4 (i.e. realtime report). As someone that spends a lot of time in Google Analytics, I didn’t see any benefit to getting some data in the backend of WordPress.
GA Google Analytics Plugin
To setup GA Google Analytics Plugin you just need to install the plugin and input your measurement ID in the plugin settings under “GA Tracking ID”. Next select “Google Tag” for the plugin setting “Tracking Method” (per their instructions).
When you create your Google Analytics 4 account and web property you’ll receive a measurement ID. If you have an existing account and property, you can find the measurement ID by going to the Web stream details page. The Web stream details page can be found under Admin > Property settings > Data collection and modification > Data streams and clicking your primary data stream.
Full disclosure: I base this recommendation solely research and reviews I’ve read. I have not used the GA Google Analytics Plugin myself. However, with over 600,000 active installations it’s also one of the most popular analytics plugins available for WordPress. And personally, I like their focus on performance and doing one thing well.
Should I Use Google Tag Manager (GTM)?
I always recommend using Google Tag Manager when implementing a new instance of Google Analytics 4. Using Google Tag Manager extends the functionality of Google Analytics 4 (i.e. with custom events) and can make future updates easier.
If you already have Google Analytics 4 setup and working on your site it might not be worth switching your implementation though. You could risk interrupting or duplicating data collection.