How do I add my Google Analytics tag sitewide to a WordPress site?
 by Kristi Hagen

How do I add my Google Analytics tag sitewide to a WordPress site?

  • I saw your Search Engine Byte about using a WordPress plugin called SOGO Header Footer to add Google Analytics code to a single page.

    I'm wondering does the same process hold true to add code sitewide? In other words, is there a way to add a tracking code to the settings of a plugin, and have that code automatically added to every page on the site? Would that same SOHO plugin be the best way to do that or is there a better one for sitewide distribution?


Yes, you can use SOGO to add code sitewide, you'll find that setting in Dashboard > Settings > Header Footer Settings.

Another handy capability is that you can also add custom JavaScript such as markup on any individual page/post.

Some WordPress themes even have a setting where you can add your Google Analytics tracking code — sometimes you just put in the UA code, other's you paste the entire JavaScript for it. You'll have to check to see if your theme enables you to do that. If it's built into your WP theme then it's easy to do.

Another option is to manually modify the theme header.php file. Ideally you should be familiar with working in PHP to make edits and using a child theme if you do this.SEN article end


Already a member? Sign in here

Read the rest of this article,
and get all this for only $1.

  • The Search Engine Strategies Updates for January 2021
  • SEN's Monthly Marketing Podcast for Strategies on the Go
  • Ultimate Guide to Avoiding Google Penalties
  • The Complete Site Audit Checklist
  • The Definitive Local Search Audit Checklist
  • 100's of Strategic SEO Articles and Q&As
  • The Internet Marketing Glossary
  • The Pro SEO's Local Search Directory List
  • 2019 Unfair Advantage SEO Beginner's Book
  • Pro's Ultimate WordPress Plugin Guide
  • The Vault: SEN's Internet Marketing Research Libraries
  • PLUS, as a Full SEN Basic Member, you'll be eligible for hundreds of dollars of discounts on SEO courses ranging from beginner to master on a variety of topics including organic search, local search, and social networking.

  • Your $1 Trial is good for 7 days at which time your card will be charged $29/mo unless you cancel before January 27th, 2021

 This form is encrypted for your security