How to Add Google Analytics to WordPress in Flatsome Powered Website

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.

google analytics page
 

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.

create google analytics account
 

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.

 
analytics
 

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.

 
create
 

You will be taken to Google Analytics’ terms and conditions. Accept the terms and conditions.

google terms
 

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.

google analytics data
 
 

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.

Google analytics to Monsterinsight
 

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.

 
You can visit your WP admin dashboard and click on Reports under the Insights menu to check your analytics data.
 
Google Analytics report
 

Final Words

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.

Hi, I’m Mohamed. I share delicious recipes that I have cooked and loved. I’ve been food blogging for over 10 years and have a Diploma in Nutrition. You will find many healthy recipes as well as my favourite comfort food on the blog because I believe in a balanced diet.

Related Posts

How to Reset Your Apple ID Password: 5 Simple Ways

Forgetting your Apple ID means getting locked out of your Apple devices and services like Apple Music, iCloud, App Store, and more. But don't panic if you…

The Ultimate Guide to Cleaning Your Smartphone

We use our smartphones every day, so it's no surprise that dirt and debris can quickly build up on our screens, cameras, or connection ports. If your…

7 Ways You Can Help Your Fitbit Last Longer

Unlike many pieces of technology, fitness trackers such as the ones from Fitbit are often built to be durable. However, you still have to make a conscious…

The Best AIO Coolers to Keep Your PC Cool in 2024

All-in-one (AIO) coolers let you add new features to your home or work PCs while still preventing them from overheating or fan damage. AIOs are highly efficient…

How to Use FaceTime on Android

Although FaceTime is exclusive to Apple devices, you can still participate in FaceTime calls as an Android user if an Apple user invites you. Below, we'll teach…

The Best Wi-Fi Cards for Your PC in 2024

A Wi-Fi card is a cost-effective way to add or upgrade wireless connectivity on your desktop PC. These PCIe adapters offer varying performance and features based on…