Google Analytics is one of the best tools at your disposal for learning more about your visitors. You can learn 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 setup Google Analytics in your Flatsome WooCommerce theme.
In this article, how to add Google Analytics in 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 sing up. The signup process is quite simple. If you already have a Gmail account, use that to sign in.
Step 1: Visit Google Analytics homepage and click the Signup button to login 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 be asked to provide account details. For account name, you can use your name or business name. Click Next to continue.
Step 3: You’ll be given choice to choose between a website or mobile app. Make sure you select website and click on 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 Google Analytics in Flatsome WooCommerce theme.
Add Google Analytics in 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 to use a WordPress child theme, if you go to the manual route. Otherwise, your tracking code will be overwritten if you switch or update the theme.
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 the steps 5 or visit Google Analytics Account.
After that, go to Theme Editor under Appearance menu on your dashboard. Select 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 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.
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.
You will find lots of plugins in the WordPress repository. For demonstration purpose I am showing the process with MonsterInsights. Because, 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 bring the MonsterInsights setup wizard. Click on 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 to Google accounts. You’ll be asked 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 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.
Next step, it’ll show you paid recommended Addons. You can simple Save and continue.
MonsterInsight is all set up and ready to use. Though, it’ll take some time to see your stats on Google Analytics. You can Finish Setup & Exit Wizard.
You can simply visit your WP admin dashboard and click on Reports under Insights menu to check your analytics data.
There are many other popular Google Analytics plugins available. Other plugins almost works similar. But make you don’t install more than one analytic plugin at the same time. Because it may artificially inflate your website visitor numbers.
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.