In this post learn about how to add Google Analytics to a WordPress website. Google Analytics allows webmasters to track and analyze a website’s traffic. You can connect a WordPress site to a Google Analytics account in multiple ways.
- Add Google Analytics to WordPress without plugin
- Add Google Analytics to WordPress with a plugin
1. Add Google Analytics to WordPress without plugin
You can track your WordPress site in Google analytics by adding the tracking code to the header of your WordPress theme.
Note: You must have a Google Analytics account before you begin the following setup. If you don’t have an account, then you will need to create an account.
- Access your Google Analytics account and copy your tracking code snippet.
- Access your WordPress files via hosting or FTP.
- Navigate to the /wp-content/themes folder for your WordPress site.
- Open the folder for the theme you are currently using on your site.
- Open and edit the header.php file. If your theme does not have a file named header.php, then you will need to locate and edit the file that contains the wp_head() code.
- Paste your tracking code snippit just before the following code.
- Save and upload the updated file.
- Visit your site so that traffic is recorded in your Google Analytics account.
- Check your Google Analytics reporting to confirm the file was correctly updated.
2. Add Google Analytics to WordPress with a plugin
You can set up your WordPress site with Google analytics using a plugin, instead of manually entering the tracking code into your files. A plugin that helps with this process is the Google Analytics for WordPress by MonsterInsights plugin. Remember, whenever you’re deciding on a new plugin be sure to check the developer’s page to determine if they’re still maintaining the plugin with updates.
If you don’t already have a Google Analytics account setup, then you will first need to create an account.
- Log in to WordPress.
- Install & Activate the plugin. Follow the YouTube video Plugin | Step by step video on How to Install & Activate a WordPress Plugin | Hosting Column.
- Locate the new sub menu in your main Settings menu labeled Insights, and click it.
- Click Settings under Insights.
- Then click Authenticate with your Google Account.
- Now click Next.
- And then click Click to Get Google Code
- If necessary, login to your Google account when prompted.
- Click Allow
- Copy the code that is provided.
- Return to the browser window with your Insights settings and paste the code where it says “Paste Google Code Here“.
- Click Next.
- Select the Google Analytics profile you want to use.
- Click Next.
- Click Close.
In these ways, you can add Google Analytics to your WordPress website and start monitoring your website’s traffic.
Thanks for visiting, do browse ads shown in this post to get the various offers, deals, discounts on amazing products & services. For queries & suggestions, mails are welcome on firstname.lastname@example.org.