How to add Google Analytics or any code to WordPress

Note: “Add Google Analytics (or any code) to WordPress” was originally posted on the Racine WordPress Meetup website.

There are many ways to insert codes like Google Analytics to your WordPress website. The method you choose will depend on your level of expertise and the plugins and theme that you are currently using.

Methods for adding Analytics to WordPress

Like most tasks in WordPress, there are many ways to achieve what you need. You could use your theme, a plugin, or edit your theme manually. Generally, adding code with a theme or a plugin is considered easy to accomplish, while editing your theme should be left to advanced WordPress users.

Using a reliable plugin to add code is the easiest solution

  1. Add code to WordPress using a plugin (easy to intermediate)*
  2. Add code to WordPress by editing your theme code (advanced)

Plugins to add code to WordPress

I’ve made a list of well-maintained and supported WordPress plugins that allow you to add code to your website.

Adding Executable PHP to WordPress

If you need to run PHP in WordPress, then make sure that the solution you choose works on more than just Google Analytics. Some plugins, like GeneratePress Premium allow for executable PHP. (You will, however, need to use the GeneratePress theme.)

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Table of Contents

On Key

Related Posts

Page Speed Monitoring

The Importance of Page Speed Monitoring Page speed monitors detect changes. Without monitors in place, your website can slow to a snail’s pace, resulting in

Getting Your Business Found Online

How consistent are your business listings online? Your customers could be trying to reach you right now. Why wait another day? The longer you wait

Ad Rank on Google Ads

Definition: “Ad Rank” A value that’s used to determine your ad position (where ads are shown on a page relative to other ads) and whether