How to start with the Google Analytics for WordPress

Google Analytics is an analytics service that tracks and reports traffic of your website. It is part of a Google Marketing platform. With this service, you can review online campaigns and goals (conversions). Conversions include sales, views of a specific page and downloading files. The integrated part of Google Analytics is Google Ads. Google Ads help you to find an ideal keyword for your content and enhance webpage traffic. Today we will talk about how to start with the Google Analytics for WordPress.

How to start with the Google Analytics for WordPress

First of all, you need to have a Google Analytics account. If you already have a Gmail, you can directly sign in. If you don’t have a Google account, you can create it on the Signup page.

After sign-in with your Gmail, you should click on the “Sign up” button on the right corner of the page. Now you are configuring data about your website. First, you have to choose between a website and a mobile app. Then you have to enter the account name, website name, and URL, industry category and reporting timezone. After that, you will get a Tracking ID.

Installation of the Google Analytics

There are two ways to install Google Analytics to your WordPress website. The easier one is to use a specialized WordPress plugin. These plugins will connect with your Google account and allow you to see the reports. On the other hand, you can install Google Analytics in a WordPress theme. This method is for advanced users who know the code. In this case, you should edit the header.php file or the function.php file. To add a tracking code in the header.php file open your WordPress dashboard and go to Appearance and Editor. On the right side, you can see Theme Files, choose the Theme Header. Paste the tracking code from Google Analytics before the closing head tag. Click to Update File.

Open the functions.php file of your theme and add the following code:

add_action(‘wp_head’, ‘wpb_add_googleanalytics’);
function wpb_add_googleanalytics() { ?>

// Paste your GA tracking code

<?php } ?>

Now you should have a connection between your Google Analytics and WordPress. If you would like to know more about the use of Google Analytics or the plugins, read the tips on our blog. If you want to help with your site analyzing, you can also choose a specialized team such as our MyWPStaff.