Google Analytics in WordPress without plugin

Sign up for Google Analytics for free

Google Analytics is a free tool and anyone with a Google account can sign up and benefit from this amazing tool. Follow the steps below to sign up for Google Analytics:

  1. Go to  in your favorite browser
  2. On the Sign Up page, click the Sign Up button   and sign in with   your Gmail ID . 
  3. Fill out the form  with basic details about your site and site type category

Submit  the registration form and  accept the terms and conditions  together with the GDPR compliance  policy

  1. That’s it, you’ll now be navigating to the Google Analytics admin page

You have now successfully signed up for a free Google Analytics account.

Get the Google Analytics tracking code

Once you’re on the administration page after you first sign up, you’ll see the Google Analytics tracking code that you’ll implement on your site. Or you may need to navigate to get the tracking snippet.

Follow these steps to get the Google Analytics tracking code:

  1. Sign in  to your Google Analytics account
  2. Click the  Administrator tab  with the Gear icon – there will be 3 sections:  Account, Property,  and  View
  3. Select  Tracking Information> Tracking Code  in the Property section 
  4. In the Website Tracking section of the  Tracking  Code, you’ll find  the global site tag (gtag.js)
  5. This is your Google Analytics tracking code with tracking ID:  UA-XXXXXX

Copy the tracking snippet and paste it with the <head>… </head> tag on your website.

Enter the Google Analytics tracking code

We can easily insert the Google Analytics tracking code into a WordPress site without using any additional plugins. Follow the steps below to insert the GA tracking code:

  1. Log in  to the WordPress dashboard
  2. Navigate to  the Theme Editor  from the Appearance menu 
  3. Open the header.php file   in the Theme Editor
  1. Look for the closing head tag – </head>
  2. Copy and paste  the Google Analytics tracking code just before you close the </head> tag
  3. Update  and  Save the  header.php  file in the Theme Editor
  4. That’s it!

The GA tracking code is inserted into the WordPress <head> on the site.

Refresh and test the visitor in real time

Once the GA tracking code is installed, you can check your own visit session in the real-time presentation report.

  1. Sign in  to your Google Analytics account
  2. Place your cursor and click on the tab in the left bar named –  Real-time
  3. And select the Overview Report   in the real-time tab

Here you can check all the pages you interact with on your site in real time.

Quickly browse some pages or post on your site and see the graph  per second  for the number   of  page views  . The most important  active pages  will display the page you are currently visiting.

You can check out other reports tomorrow to see the full aggregate interaction with other visitors you’ve received on the site. Although you can only identify yourself if you are the only visitor to your new site.

Google Analytics is also available as a native smartphone app on both Android and iOS devices.

You May Also Like

More From Author