How to Install Google Analytics on Your WordPress Website as a Beginner?

How to Install Google Analytics on Your WordPress Website as a Beginner?

How to Install Google Analytics on Your WordPress Website as a Beginner?

Having a website and driving traffic is not enough if you don’t know whether the traffic is worth. And by worth we mean, whether they’re likely to convert to customers and become profitable. Therefore, you must ensure you’re targeting and driving the right traffic. Google Analytics is an excellent, free tool offered by Google to analyze the traffic and ensure you’re targeting the right people. In this guide, we’ll show reveal the steps you can use to install Google Analytics on your WP website.

Sign Up for Google Analytics

Before you can install Google Analytics or GA on your WordPress website, you need to have an Google Analytics account. If you have one, that’s great! But if not, then you need to sign up. And that’s easy.

  • Start by visiting the Analytics registration page. You’ll be using your Gmail ID to sign up.
  • Once you’ve signed up, you’ll have to set up an account name. This can be anything you can remember.
  • Next, choose a web property you want to track. The options will be a web, app, or apps and web. For your WordPress website, you have to select web.
  • Finally, input the website name, URL, country of location, and time zone.
That’s it. You’ve successfully arranged Google Analytics for analyzing your WP site. Grab the GA tracking code that will be used later. You can leave the tab open or close it as per you preference.

Install Google Analytics on your WP Website

There are basically two ways you can install GA on your website. Each one is different from the other in execution terms, but the end result is same.
  • Insert Headers and Footers
The first way you can install Google Analytics is by doing some code work. Well, not writing codes, but including them at the right places, which are the header and footer section of your WordPress website.

First go back to the tracking code that GA generated for you when you added your website and URL. If lost, then you can find it under the Admin section. The follow the steps:
  • Log into your WordPress dashboard
  • Navigate into Appearances>Theme Editor
  • Open the header.php file which is also called the Theme Header file
  • Now paste the code you just copied before the closing head tag which is “</head>”
Now save the file. To confirm, visit your GA admin section and look for the green status.

Alternatively, you can also add the code to the functions.php file. Add the following code:

Code:
<?php
add_action('wp_head', 'wpb_add_googleanalytics');
functionwpb_add_googleanalytics() { ?>
// Paste your Google Analytics tracking code from Step 4 here
<?php } ?>
  • Install the Google Analytics Plugin
The second way is to use the plugin provided by Google itself. To find this plugin, go to WP plugin directory and then conduct a search for “Analytics” or “Google Analytics”. Select the one that you find relevant since there are many plugins that include your GA code.

Install the plugin like you’d normally do and go to the dashboard. It’ll ask you for the code Google Analytics generated for yourself. Provide the code and it’ll do the editing work. To confirm Analytics was properly installed, go back to your GA dashboard and look for the status.

It will take some time for Google Analytics to start tracking traffic for your website. But once underway, it will show you explicit details at the granular level.
Author
bhawanisingh
Views
2,630
First release
Last update
Rating
0.00 star(s) 0 ratings
Top