How to Add Google Analytics with WordPress

How to Add Google Analytics with WordPress in Flatsome WooCommerce Theme to Track Store Traffic.

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 with 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 with 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 Google Analytics with WordPress

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 a 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 easily get the experience.

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 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.

 
 
monsterlights
 
 

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 simply Save and continue.

 
 
 

MonsterInsight is all set up and ready to use. You can Finish Setup & Exit Wizard.

 
 

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

 
 
 
 

Final Words

There are many other popular Google Analytics plugins available. Other plugins almost work similarly. 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 blog 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.

Leave a Comment

Your email address will not be published. Required fields are marked *