• Home
  • Your Author
  • Reviews
  • Resources
    • Glossary
    • Guides
    • SEO
    • Tips
  • Contact
My #1 Recommendation
Earn Cash In CollegeEarn Cash In College
Earn Cash In CollegeEarn Cash In College
  • Home
  • Your Author
  • Reviews
  • Resources
    • Glossary
    • Guides
    • SEO
    • Tips
  • Contact

How To Set Up Google Analytics On WordPress

How To Set Up Google Analytics On WordPress

May 3, 2018 Posted by Dev Guides, SEO, Tips No Comments

Google Analytics (GA) is one of, if not the most common form of web performance tracking tools available. WordPress is also the most commonly used Content Management System, or CMS, used today. Knowing how your audience interacts with your website’s content is critical to your ability to improve your site as well as your site’s overall success.In this guide I am going to show you a number of ways how to set up Google Analytics on WordPress.

Before we get in to setting up GA on your WordPress site. Let’s find the codes you’ll need to do so.

  • In your Google Analytics account, you’ll notice in the lower left corner there is a gear that says “ADMIN” next to it. Click that gear.
  • You will then be brought to your admin page where there are 3 columns: Account, Property and View.
  • Under the Property column you should see your website name if you’ve already set up your GA account.
  • Click the “Tracking Info” link in that column:

  • Then click “Tracking Code”.

 

This will bring you to the page with your “UA-” code and your Javascript code. Which one of these you need will depend on which of the below methods you choose.

Method #1: Use a Plug In (UA Code)

There are dozens if not hundreds of plug ins available to implement your Google Analytcs code onto your WordPress site. My recommendation here is to choose an SEO plug in that does far more than just GA code implementation. That way you don’t have to have 2 plug ins to accomplish what you can do with just 1. At the end of the day, the more plug ins you have the slower your site will load, so less is always more when it comes to WordPress plugins.

Recommended Plug In: All In One SEO

To install the All In One SEO plug in you need to either navigate to the plugins page in your WordPress dashboard by hovering over the “Plugins” tab in your left sidebar and clicking “Add New”.how to install google analytics wordpress

This will lead you to the Add Plugins page. In the upper right hand section of that page you will see a search bar that has a box that says “keyword” in it and a search box with “Search plugins…” placeholder text.

Simply start typing in “All In One SEO” and the page will start updating with relevant results. By the time you type out “All In One” you will likely see the plug in appear.

You will see a box that looks like this:

how to install google analytics wordpress

However where it says “Active” in the top right, it will say “Install Now”.

Go ahead and click install now, then once it finishes installing click “Activate”.

Once activated you will notice in the top left of your WordPress sidebar there is a tab for “All In One SEO” just below the Dashboard link.

Go ahead and hover over that and click “General Settings”.

Now All In One SEO is a very powerful and robust plugin with tons of great features. I am going to write a separate post on how to best configure these settings for improving your website’s SEO. For now though, we are just setting up Google Analytics on your WordPress site.

On the General Settings page you’ll want to scroll down about halfway until you see a heading that reads “Google Settings”.

Scroll down just a little further until you see “Google Analytics ID” just below the Specify Publisher URL field and just above the Advanced Analytics Options field.

Paste the UA code that you found earlier in that Google Analytics ID field, check the “Advanced Analytics Options” button to Yes, scroll down to the bottom of the page and click the blue “Update Options” button the the bottom left of the page.

And your done! You now have Google Analytics fully implemented across your website.

Method #2: Install Into Header.php (Javascript)

Warning: This is only for advanced users. You will be directly editing your website’s core code.

For this method you will need 2 things:

  1. A text editor, such as sublime text or notepad
  2. An FTP Client

Steps for Google Analytics code implementation:

  • First, take the Javascript code you found at the beginning of this lesson and place it into a notepad document.
  • Next, connect to your site via FTP (Your web host should have set this up for you).
  • Navigate to your theme folder by clicking Wp-Content -> Themes -> [Your Theme Name]
  • Inside the [Your Theme Name] folder you will see a file titled header.php.
  • Download that file and open it in your text editor
  • Save As… that file as header-original.php and set it aside.
  • Now re-open the header.php file you originally had opened. The code should be identical. Just a different filename.
  • Scroll down until you see <body> (known as a body tag) and paste the javascript code you set aside directly into the file.
  • Save the header.php file and re-upload it back to your theme file that you downloaded it from.

This should replace the old header.php with the new one – which is exactly the same + a Google Analytics code.

Now open your site and open Google Analytics to test 2 things:

  1. Your visit is being tracked
  2. You didn’t break anything by messing with header.php.

Something go wrong?

If you broke anything, you have a backup saved of your header.php. Simply paste that original code back into the header.php you have saved locally, replacing all the code that was there with the original code, and save. Then re-upload header.php again.

Wrapping Things Up

There are more ways to install Google Analytics on WordPress and I will add them to this post later. However if you are just getting started, I highly recommend going with the plug in option. You have far less chance of messing anything on your site up this way and the work is significantly less.

I hoe you found this guide helpful. Should you have any questions or concerns, please feel free to leave them in the comments box below. I’ll get back to you as soon as I can.

 

No Comments
Share
0

About Dev

Dev has been working in the online marketing industry for close to a decade. He originally learned SEO through Wealthy Affiliate while in college to earn extra income instead of getting a part time job and started working in the PPC industry right after graduation. After about 6 months he began working as an SEO Specialist. He remained in this position for 3 years before becoming a Project Lead at the same company.

    You also might be interested in

    How To Make Money On Fiverr

    How To Make Money On Fiverr

    Apr 4, 2018

    For those of you who haven’t heard, Fiverr is a[...]

    Learn If the Acorns Investment App Is A Scam: My Review

    Learn If the Acorns Investment App Is A Scam: My Review

    Apr 2, 2018

    Product name: Acorns Creator: Noah Kerner Date Created: 2012 (Mobile[...]

    The Best Affiliate Marketing Tools of 2018

    The Best Affiliate Marketing Tools of 2018

    Apr 13, 2018

    Being successful in affiliate marketing requires many things. First and[...]

    Leave a Reply

    Your email is safe with us.
    Cancel Reply

    Recommended Products


    Grade: A+
    Read Full Review


    Grade: A
    Read Full Review

    Browse Categories

    Most Active Posts

    • What Is Wealthy Affiliate? By Dev on February 19, 2018 32
    • How To Make Money On Fiverr By Dev on April 4, 2018 14
    • Is Affilorama A Scam? An In-Depth Review By Dev on March 30, 2018 14

    © 2023 · EarnCashInCollege.com

    • Home
    • Privacy Policy
    • Affiliate & Earnings Disclosure