• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Klong Designs

Klong Designs

Wordpress Designer, Developer and Web Programmer

  • Home
  • About
  • Services
    • WordPress
      • Theme Design
      • Plugin Tweaks
      • Site Migrations
    • Graphic Design
    • Custom Programming
      • Responsive Design
    • SEO
  • Articles
    • Facebook
    • HTML
    • jQuery
    • PHP
    • WordPress
  • Contact/Quote Request

Google Analtyics: Hard Coded or Plugged In?

October 16, 2013 By Chris Klongpayabal

I’ve received several questions from clients about their google analytics setup. The big question is where should they put in their code? I’ve seen developers state that you need to put in your code in the header.php file of a theme, which is normally what I would say. But I’ve come across something that has changed my mind about that.

What happens when you change themes?

I know I like to try out different themes from time to time, or even test drive the new WordPress default themes when they are released.  Many of my clients use free themes and change the look of their site constantly. The problem lies that their google analytics code is embedded in the header.php file of their theme, so if they change themes, they will lose the tracking code, and all tracking of their sites will stop.

Luckily, it’s an easy fix, but something that doesn’t need to happen. You need to separate the essential functionality of your site from the theme files. This means you need to have a plugin to add your code to. If you change themes, your site will still be tracked.

For Google Analytics, I highly recommend Yoast’s Google Analytics plugin.

If you want the ability to add code to your wp_head and wp_footer, I am actually writing a plugin that will help you with that, so stay tuned for that!

Primary Sidebar

Quick Quote

Footer Quote

Footer

Services

Graphic Design - This includes (but is not limited to) logos, banners, signs, posters, business cards, rack cards, brochures, flyers, and postcards.
Website Design - This includes (but is not limited to) theme design, logo design, banner ads, post graphics, pinterest-based images, image maps and navigation design.
Website Programming - This includes (but is not limited to) HTML, CSS, Javascript, PHP, jQuery, SCSS and LESS, as well as MVC frameworks, Theme updates and tweaks, plugin updates and tweaks, Multisite setup, plugin design and customization.
SEO Work - This includes (but is not limited to) analytics review, site SEO review, video SEO, ongoing SEO updates, sitemap setup and goal tracking.
Maintenance Work - This includes (but is not limited to) Keeping WordPress up-to-date, running backups of your site and database, and answering any questions you have about your site.
If you would like more information, please fill out the quick quote form. Thanks!

Follow

A Few Client Sites

  • 5 Dollar Dinners
  • Get Rich Slowly
  • The Happy Housewife
  • I Save A2Z
  • Hip Homeschool Moms
  • Redefined Mom
  • Queen Bee Coupons
  • More with Less Today
  • Saving Advice
  • One Crazy Mom

Copyright © 2025 · Klong Designs