How To Add Google Analytics To WordPress

add Google Analytics

Are you looking for a way to add Google Analytics to WordPress site of yours? If you are, then this post is just for you. There are several ways to add Google Analytics to your website. If you are a beginner, then you may find it a bit lengthy, but trust me. 

After reading this post, you will be able to add Google Analytics to your website all by yourself. 

Let’s begin, then. 

Signup in Google Analytics

You have to register your website for Google Analytics. I have given the steps below.

Step 1: Register in Google Analytics

At first, you have to visit Google Analytics and register. 

Click on the ‘Set up for free’ button now, provide your account name, scroll below and click on the next button. 

Step 2: Create Property

Provide the property name, reporting time zone, and currency. 

Hit the next button.

Step 3: Provide Business Details

Choose the industry category, business size, and how you would like to use Google Analytics for your business. 

Step 4: Choose Business Objectives

Now, Choose your business objectives and hit the create button.

When you click on the create button, a pop-up will open with terms and conditions, choose your country and place a tick on the accept box. Click on the ‘I Accept‘ button. 

Step 5: Choose a Platform

Now, you will be asked to choose a platform. Click on the Web platform. 

Step 6: Create a Stream

Provide your website link and name it anything you like in the Stream box then click on the Create stream button. 

Setup is now complete.

Step 7: Get Tag Code

Click on the ‘Tagging Instructions’ and get your tag code.

Now you will be provided with the tag code. 

Add Google Analytics to WordPress Theme

This is one of the easiest methods. First, copy the tag code that you got above. 

Now navigate to Appearance -> Theme File Editor. Open header.php in your WordPress theme and paste the Google Analytics tracking code right after <body> tag.

Save your changes. 

Alternate Option

If you wish you can also add Google analytics through the Functions file. Navigate to Apperance -> Theme Files Editor and open functions.php. Now add this code. 

<?php
add_action('wp_head', 'wpb_add_googleanalytics');
function wpb_add_googleanalytics() { ?>
 
// Paste your Google Analytics tracking code
 
<?php } ?>

Don’t forget to paste your tracking code in the above code. 

View Report

To view the report, you have to visit the Google Analytics website. From there, you will be able to see any type of report you wish to view. 

If you want to view your report in your dashboard, then you may take the help of the MonsterInsights plugin. It shows you all your reports with more details directly in your dashboard. 

Last Words

That’s it. I hope you have successfully learned how to add Google Analytics to WordPress easily. If you have any questions, feel free to ask, and don’t forget to share your thoughts in the comments box below. 

Was this helpful?

Thanks for your feedback!

Leave a Reply

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

Introducing New Table Block Plugin - Tableberg

X
Need help?