Add Your Google Analytics Code to GeneratePress Without Extra Plugins

/ Last Updated:

I’ve written about how I’ve gone all-in with the GeneratePress theme for all of my niche sites. One of the biggest reasons I love GeneratePress? Speed.

I love to build a lean, mean, affiliate marketing machine. Extra plugins that slow down the site are not welcome on my sites.

I’ve seen lots of plugins that exist simply to plug in javascript code into various areas of a website. Some scripts need to go in the head, some in the footer, etc…

I’m not a big fan of adding javascript to my sites. I recommend you avoid it at all costs to keep your site as fast as it can be.

One piece of javascript that we all cannot live without is the Google Analytics tracking code. While I can live without a lot of bells and whistles, I cannot live without my analytics.

Here is how you can very simply add the analytics tracking script to your site using the GeneratePress theme.

Here Are The Basic Steps

  • Appearance > Elements > New > Hook
  • Add a title and paste in your GA Script
  • Ensure that wp_head is selected from the hook list
  • Set a Display Rule for “Entire Site”

Here is a Video That Shows The Steps

Watch me set up Google Analytics script as an element in GeneratePress

1 thought on “Add Your Google Analytics Code to GeneratePress Without Extra Plugins”

Leave a Comment