Google Analytics is one of the best tools at your disposal for learning more about your site visitors. You can learn How to add Google Analytics to WordPress and who your website visitors are, what they are looking for and where they come from, how long they stay on your site and etc.
It’ll help you to decrease the bounce rate and increase your pageviews. You can easily set up Google Analytics in your Flatsome WooCommerce theme. There are many WordPress analytics plugins, but Google is the game changer.
In this article, how to add Google Analytics to WordPress to the Flatsome theme will be covered.
Google Analytics is available for free. If you do not yet have a Google account, then open a Google or Gmail account to sign up. The signup process is quite simple. If you already have a Gmail account, use that to sign in.
How to Add WordPress Google Analytics
Create and Setup a Google Analytics account:
Step 1: Visit the Google Analytics homepage and click the Signup button to log in with your Gmail account. Once you sign in, you will be prompted to a screen like the below screenshot.
Step 2: Click on Start measuring, and you’ll be taken to the next steps. You’ll have to provide account details. For the account name, you can use your name or business name. Click Next to continue.
Step 3: You’ll get an option to choose between a website or a mobile app. Make sure you select a website and click on the Next button.
Step 4: Now, enter some details for your own property, like website name, website URL, industry category, country, and time zone. Once you have entered all the information, then click on Create buttons.
You will be taken to Google Analytics’ terms and conditions. Accept the terms and conditions.
Step 5: Now, you’ll be presented with your Google Analytics code. Copy the tracking code, as you’ll need to enter it depending on the method you use below.
Now you have a Google Analytics account ready. Let’s install it in the Flatsome WooCommerce theme.
Add Google Analytics to WordPress Website in the Flatsome Theme
It is simple to add the Google Analytics tracking code directly to your Flatsome theme via your header.php file.
I suggest you use a WordPress child theme if you go the manual route. Otherwise, your tracking code will be overwritten if you switch or update the theme. If you don’t know how to create a child theme on WordPress, you can follow the linked tutorial.
The easiest way to paste your Google Analytics Tracking Code right before the closing </head> tag in your header.php file and save changes.
To find your analytics tracking code, follow step 5 or visit your Google Analytics Account.
After that, go to Theme Editor under the Appearance menu on your dashboard. Select the header.php file for your child theme. Paste the tracking code right before the </head> tag in the editor. Make sure to click on the Update File button. The tracking code will be activated successfully.
There is another method you can add Google Analytics to WordPress to the Flatsome theme. Head to your WordPress admin dashboard. Look for Advanced under Flatsome and click on Global Settings. You’ll find Header Scripts to paste your analytics code
Use MonsterInsights plugin
One more method you may try. For that, you’ll need a plugin that will automatically add the tracking code to your site for you. Although other SEO plugins in WordPress can do the tracking processes, MonsterInsights is specially designed to track codes that other plugins rarely do.
There are lots of plugins in the WordPress repository. For demonstration purposes, I am showing the process with MonsterInsights. As it is the most popular Google Analytics plugin for WordPress.
Now let’s get started.
Install and activate the Monsterlights plugin from the WordPress admin dashboard. You can follow this guide to get help on how to install a WordPress plugin.
Once activated, the plugin will add a new menu item, ‘Insights,’ to your admin menu. It will take you to the MonsterInsights setup wizard. Click on the Launch the Wizard button.
Now you’ll be asked to choose a category for your website, such as – Business website, Publisher, or eCommerce. Select one and click Save and Continue button to go to the next steps.
In the next step, click on the ‘Connect MonsterInsights’ button. It will take you to a Google account. It’ll ask you to sign in or select an account if you are already signed in. Then allow the plugin to access your Google Analytics account by clicking on the Allow button.
Select the profile you want to track. Here, you need to select your website and click on the Complete Connection button to continue to the next steps.
Complete the recommended settings on this page and click on Save and Continue. The default settings would work for most of the websites.
The next step, it’ll show you paid recommended Addons. You can Save and continue.
MonsterInsight is all setup and ready to use. You can Finish Setup & Exit Wizard.
We hope you have learned how to add Google Analytics to WordPress in Flatsome theme. There are many other popular Google Analytics plugins available.
But make sure you don’t install more than one analytic plugin at the same time. Because it may artificially inflate your website visitor numbers, and you have to read SEO tips blogs to rank your website and analysis with these tools.
If you need more tutorials on Flatsome theme or WooCommerce, let me know in the comment section. I’ll write the next tutorial for you.