Skip to content

Easy Ways to Insert Google Analytics Tracking Codes into WordPress

The Process of Google Data Analytics

Google Analytics is a handy tool for spying over your site as well as make a detailed analytic report of the behavior of your users. Though Google limits a lot of data access for free Google Analytics, it is still a handy tool to see the insight of your website performance.

You should use a specified plugin or manual implementation method to insert Google analytic codes into your WordPress powered website. You may find many articles available on the web that covers the details of Google Analytics. Here I am going to list 5 handy ways to implement Google analytic code into a WordPress powered website.

1. Implement the code into your theme’s header: For Tracking every page you have to implement the code on every landing page of your website. As we know WordPress uses an automated .php script to generate pages, so a useful method is to implement the analytic script into the header or footer area. So that, every page and post templates are called this template to generate a webpage header and footer. This way every page is getting tracked by Google Analytics.

Here is the process: We may assume that you already have your own Google analytic account and also create a property with necessary settings. Just log in to your Google analytic dashboard and copy the tracking code.

Google Analytics Tracking Codes

Copy the code snippet and open the Appearance> editor tab from the WordPress dashboard. Now, find the header.php. Open the file in WordPress editor and place the code after the <body> tag. See the picture below.

WordPress Editor

If you do not understand PHP or HTML code, then do not apply this method. You can solve the implementation issues with a plugin or premium themes that have an option to implement custom header or footer code.

2. Implement the tracking code using a plugin: If you do not like to edit your theme’s file, (remember that your code is disappearing after the next theme update) You can use either a plugin or themes that enable you to insert header or footer codes. Here are some recommended plugins that you can use to simplify your analytics implementation process.

Here’s the list of free plugins that you can use, but you can also use some premium themes or plugin for more details option. That is it. No more today!

Have a beautiful day and a great weekend!