In this video I go over briefly how to create a google analytics account and how to install the code on your self-hosted WordPress website to start collection stats.

I actually have two methods to show you. First, I show you how to directly copy and paste the code into your WordPress theme and then I’ll show you how to setup a Google Analytics plugin.

Option 1: Copy Your Google Analytics Code into your WordPress Website

  1. Signup for a Google Analytics Account
  2. Copy the tracking Code
    • If you just signed up then you’ll be redirected to the tracking code page automatically. Otherwise, if you already have an account navigation to the tracking code by going to Admin > Tracking.js > Tracking Code Google Analytics Tracking Code
  3. Copy the code into your Theme’s header.php file
    • Go to your WordPress Dashboard
    • Navigate to Appearance > Editor 
    • Open header.php
    • Paste the code just BEFORE the “</head>” tag Google Analytics Header
  4. Verify the code
    • Within a few minutes, Google Analytics will let you know if it’s picking up the code on the tracking code page (look for “Status: Receiving Data”) Google Analytics Tracking Code


Option 2: Install A WordPress Plugin to Collect data for Google Analytics

As an alternative, you can install a plugin that will install that Google Analytics code for you


A plugin will give you a snapshot of your stats in your WordPress Dashboard 

AND (what I think is most important)

It will exclude all of YOUR visits to your website. ie: If you are logged into your WordPress website and preview content, test out form, etc – all your data doesn’t get tracked.

So here are the steps to get your plugin install and working with google analytics. 

  1. Signup for a Google Analytics Account
  2. Install Google Analytics Dashboard for WP Google Analytics Dashboard For Wp
    • Go to your WordPress Dashboard
    • Plugins > Add New
    •  Search for Google Analytics Dashboard for WP 
    •  Install
    • Activate
  3. Go to Google Analytics (a new menu item on your sidebar)
  4. Enter the Access Code
  5. Go to Tracking Code Select “Administrator” (and other roles that you don’t want to track)

Et Voila! Now you have Google Analytics setup for your WordPress website!

Here’s a video going through all the steps outlined above


Leave a Reply

5 thoughts on “How to Install Google Analytics for your WordPress Website

  1. I’ve been looking for an easy guide like this, so thank you! Does this also work for or only .org sites?

    Posted on October 23, 2015 at 9:34 pm
    1. Oh great! Glad you liked it. This is specifically for .org or a self-hosted site.

      Posted on October 30, 2015 at 3:46 pm
  2. fabulous tutorial! I’m loving the dashboard plugin – thank you! I’m a total blog newbie, so this was an easy straight forward tutorial for me to follow. Can’t wait to browse your site for more tutes 🙂 thanks!

    Posted on January 7, 2016 at 11:26 am
  3. hii,, i’m from Indonesia
    This tutorial is so much helpful. Thanks a lot for sharing.

    Posted on November 2, 2016 at 6:49 am
  4. Hello — This is fantastic and easy to follow. However i have a question? Should we do both? or why one versus the other?

    Posted on December 16, 2016 at 7:31 am