Adding your Google Analytics tracking code to your WordPress site manually, versus using a plugin can have it’s benefits. There are many different plugins that you can install that will help you without knowing any PHP. Many plugins also give you access to your Analytics’ Dashboard that allow you to track traffic, users demographics, page views etc… directly through the backend of your WordPress site. However, sometimes installing these plugins can cause your webpage to load slowly and it’s also an added plugin that needs to be backed up along with your site. If you are the type that changes your WordPress theme quite often, or are still trying to perfect the look and feel of your blog, using a plugin may be helpful for you. On the other hand, if you are likely to switch themes often or frequently customize your blog/website, you would have probably become aware of where to place your Analytics code anyway. Below are instructions describing where to place your Google Analytics (GA) code within the WordPress Dashboard. You can also open up your footer.php (or even header.php) file in any code editor and place the code above your closing body tag. </body>.
How to add Google Analytics code manually through WordPress Dashboard:
- Login to your WordPress admin panel.
- Go to Appearance > Editor.
- Select the footer.php file on the right hand side.
- Find the </body> tag.
- Paste your Google Analytics code right before the </body> tag.
- Select Update File and save the changes you have made.
When manually placing your Analytics code within your WordPress site, you will need to place it again every time you decide to change your theme. If you are comfortable with your current theme and styling of your site, manually entering your Analytics code will free up the amount of storage space on your server by not having to install a plugin. It also saves you from backing up additional files.