How to Install Google Analytics in WordPress

TDesigns Creative Desk > Blog > How to Install Google Analytics in WordPress

Source copied from infophilic.com for original link  click here

Making an ideal user experience for your site’s users isn’t a precise science, however focusing on specific performance metrics can give you direction for how to increase their traffic and user retention.

Here’s is when web analytics plays a vital role. When it comes to getting detail insights on your website/blog, web analytics offers your visitor’s data so that you can put your efforts to optimize your content based on users’ interest.

Key benefits of web analytics:

  • Supports the qualitative research and testing.
  • Encourage a data-driven environment for decision making.
  • Provide insights with the data.
  • Offers information on Traffic referrals.
  • Helps in improving ROI by doing behavioral Analysis of Visitors over time.
  • Understanding customer demographics.

While there are different web analytics tools you can use to gather, analyze and visualize your site information. However, the most well known that one should use is Google Analytics. You can integrate Google Analytics code into your blog/ site.

Google Analytics is a web analytics service offered by Google to help you understand your website visitors. It shows you the amount of traffic your website is getting, from where it is coming and how visitors interact with your site once they arrive.

The tool works by gathering data on how your site is performing, then saves that data to your Google Analytics dashboard. Every time when users come to your site in their web browser, they are tagged by the tracking code and their “session” on your website begins.

This data is particularly valuable in figuring out which of your marketing strategies is the best. It is additionally valuable for figuring out what kinds of users are visiting your site and why.

Getting started with Google Analytics:

Visit https://www.google.com/analytics/ and sign in with your Gmail account.

After signing in you will see the Sign-Up screen for Google Analytics.

Sign up for Google Analytics.

Click on Sign up button. You will be given with choice to choose between a website or a mobile app. Select for the Website. Once you selected the website, a screen will appear that will ask for your account details such as your account name, domain name, domain URL, company category and time zone.

Create a Google Analytics account

Fill this information, click on Get Tracking ID button. A document with ‘Terms and Conditions’ will appear. Read the document carefully and click on I Agree.

You will get your Tracking code on the screen. Copy the code and paste it in your notepad (temporarily), as you will need it while installing Google analytics in your WordPress.

Now, you have successfully done with setting up a Google Analytics account.

Note: Do not close the tab as you may need to revisit it.

The next procedure is to install Google Analytics to your WordPress site/blog.

How to install Google Analytics to your WordPress?

There are two ways to set up Google Analytics in WordPress. I will show you the complete process for each method.

Install Google Analytics in WordPress Theme:

If you prefer to add Google Analytics to WordPress without a plugin, then its quite simple to add it using header.php file and function.php file.

a. Using the header.php file:

Edit the theme’s header.php file and paste the analytics code right before the closing tag.

Adding Google Analytics code in header.php file

Save the changes and re-upload the file back to the server.

b. Using function.php file:

Another way is adding analytics code to function.php file. To do so,

  • Edit the function.php file in your WordPress theme.
  • Add the following code at the bottom of code in the file:

Do not forget to replace /* --- PASTE YOUR GOOGLE ANALYTICS CODE HERE -- */ with your Google analytics code.

After adding this code, check and ensure that your website’s reports are appearing on the Google Analytics dashboard.

How to view a site report on Google Analytics?

To view site report you have to visit your Google Analytics Dashboard.

Google Analytics report dashboard

You will see different sections divided into different tabs. You can check detailed web analytics for your site by clicking on the options.

Leave a Reply

WhatsApp WhatsApp us