How to Add Google Analytics to your WordPress Site with Kadence

Google Analytics is the first choice for site owners looking to learn more about how their customers are using their site, no matter what content management system they’re using. And Google Analytics is Adding Google Analytics to your site is relatively easy, and the knowledge and insight you gain from Google Analytics is enormous. 

In this article, we’re looking at the benefits of using Google Analytics and how easy it is to add to your site if you’re using Kadence Pro. 

Benefits of Using Google Analytics

  • Identify the source of site traffic. Find out where your visitors are coming from so that you can nurture those traffic sources and grow your audience. Double down on what is working, and stop doing what is not.  
  • Understand site usage. Once you get a site visitor, you can learn more about what they’re doing on your site once they get there. Discover if there is a certain path through your site that leads to user’s engaging deeper with your brand.
  • Make better decisions about content creation. What blog posts are getting the most visits and dive deeper on those subjects to give site visitors more of what they’re coming for. 
  • Track conversions and sales. If you are using WooCommerce, Google Analytics can help you track conversions and see where your revenue sources are coming from. 
  • Make better decisions about design. Is the page that is less image heavy converting more? Or maybe it’s not connecting with your audience quite as much.
  • Track your on-site search. When people arrive on your site and use your site’s search features, what are they looking for? Determine what terminology they use so you can communicate with site visitors using the same language they use. If they’re looking for “silverware” but you’re selling “utensils” maybe you can change your language to sell more.
  • Watch real-time interactions. Just send out a mailing? Or maybe that blog post ended up on the front page of Reddit or Hacker News? Watch real-time analytics to see how your site’s being used during times of intense traffic. 

Adding Google Analytics the Hard Way

If you’re a glutton for punishment, there are a number of hard ways to add Google Analytics to your site.

Dive into the Code

If you were to add Google Analytics to your site without using Kadence Pro or a specific plugin, you’d have to add tracking codes from Google Analytics to your theme’s header files. You’d have to find your theme’s header file either via FTP or the WordPress Theme File Editor, and you’d have to place that code in the correct place. If you opt to go this route, we recommend making a backup of your site (Backup Buddy is a great choice) in case something goes wrong. Any mistake you make could create issues for your entire site. 

One problem with this approach is that an update to your theme will require re-adding your Google Analytics tracking codes to your site’s header file again. Often, site owners forget about this step and find gaps in their tracking data, losing out on important insights. 

Using a Child Theme

There are a number of child theme generator plugins that can prevent this problem. A child theme inherits elements from the primary theme, but adds your own custom code. To use a child theme, you’ll need to add the plugin, generate the child theme, and then add your tracking code to the child theme. In this way, an update to the parent theme update won’t wipe out your tracking code stored in your child theme. You still run the risk of pasting the tracking code into the wrong place and breaking your site, so definitely still run a backup prior to setting up a child theme.  

Using Yet Another Plugin

There are numerous plugins in the repository that can allow adding Google Analytics to your site easily. You’ll simply add the Google Analytics tracking codes to your plugin’s settings and you’re good to go. 

If you’ve used WordPress for a while, you’ve probably noticed that plugin authors can often come and go, and evaluating plugins prior to inviting their code into your digital home on the web is an important task. You want to ensure that the plugin team you’re trusting is in it for the long haul to be actively maintained, to ensure security updates are applied, and to provide support. 

Many seasoned WordPress users opt to use as few plugins as possible to ensure that there is less codebase to monitor and maintain. A quick look at the most recent iTheme’s vulnerability report is all you need to know when it comes to being selective about the plugins you choose.

Recommended Method for Adding Google Analytics to WordPress

At Kadence, we’ve got a better way. If you’re already using Kadence Pro, you’ve got all you need to ensure Google Analytics is providing the insights you need to make good marketing decisions for your audience.

If you’re using Kadence Pro, you don’t need additional plugins, you don’t need to code, and you certainly don’t need a child theme. Kadence does it all for you. When you’re using Kadence, the easiest method for adding Google Analytics to WordPress is already on your site. 

And, if you’re using other marketing services that require adding tracking to your site (such as retargeting advertising, HubSpot, or other marketing services), you may even want to use Google Tag Manager so that all of your tracking is managed in one place. Here’s a tutorial from Google that gives you an overview of Google Tag Manager that we recommend. For this article, we’re only providing an overview of adding Google Analytics to Kadence. We’ll have a future article talking about the benefits of Google Tag Manager. 

But first, let’s get started adding Google Analytics.

Adding Google Analytics to your WordPress Site the Easy Way

Step 1: Sign up for Google Analytics

First, you will need to sign up for Google Analytics. You can use an existing Google account to sign up for Analytics or create a new one.

Step 2: Ensure you have Kadence Pro

If you’ve purchased any of the Kadence Bundles, you have Kadence Pro! You can also purchase Kadence Pro as a stand-alone plugin, but we definitely recommend getting all that Kadence has to offer with a bundle.

If you’re just building out a site without commerce and you don’t need Kadence Conversions, Kadence Cloud, or Kadence Shop Kit in the Full Bundle, then the Essential Bundle will work fine for you. (And if you change your mind within 30 days, you can always upgrade!) 

Install the Kadence Pro plugin, activate it, and ensure you activate your Kadence Pro License. You can find your license key in your account dashboard on KadenceWP.com. 

Step 3: Turn on Header/Footer Scripts in Kadence Pro

In your WordPress admin dashboard, go to Appearance > Kadence. There, toggle on Header/Footer Scripts. This will add an option in the WordPress Customizer to add your Google Analytics (or Google Tag Manager) scripts. 

toggle on header and footer scripts

Step 4: Get Your Google Analytics Tracking Code

Login to your Google Analytics account and select the website for which you need the tracking code.

Click on Admin in the left taskbar.


In the property column, click Tracking Info and then Tracking Code.

tracking code

Copy the script in the Tracking Code window. You’ll want to copy everything. It will look something like this: 

Make sure you copy everything in the window; it’s all important to ensure Google Analytics works correctly.

Step 5. Head to your WordPress Customizer

In your WordPress Customizer with Kadence Pro active and Header/Footer Scripts active, you’ll have an option for Custom Scripts. 

kadence custom scripts

There, you will see three boxes where you can add scripts:

  • Add scripts into your header
  • Add scripts right after opening body tag (useful for Google Tag Manager)
  • Add scripts into your footer

Step 6. Paste in your Google Analytics Tracking Code

Paste the code you copied in Step 4 into the “Add Scripts into your header” box. For Google Analytics, you won’t need to use the other two boxes for after opening body tag or into your footer. We’ll have future articles discussing how these two options can be useful. 

Step 7. Click Publish!

At the top of the Customizer, click publish, and you’re done! It may take up to 24 hours before your analytics information starts showing up in Google Analytics. But you can add analytics.google.com to your bookmarks, and check in regularly. There are even mobile apps you can use to monitor your Google Analytics while on the go. 

Adding Analytics to WordPress is Easy with Kadence

Kadence is committed to helping anyone create more effective WordPress websites, and we firmly believe that you shouldn’t have to learn how to code to be effective marketers with your WordPress site. Getting good data from analytics platforms such as Google Analytics is the first step in understanding your audience. And we know that meeting your audience where they are and understanding their needs and how they use your site, your products, and your services is key to finding success. 

Are you using Google Analytics? How has it helped you understand your audience? Let us know in the comments below.

Leave a Reply

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.