Adding Google Analytics to WordPress without plugins is a breeze. All you need is a Google Analytics account and a WordPress site.
Once you have both of those things set up, follow these simple steps:
Log in to your Google Analytics account. Click on the “Admin” tab and then under “Account Settings” click on “Add a Property.” In the “Property Name” text field, enter “Google Analytics.” In the “Property Value” field, enter your WordPress site’s domain name (e.
g. example.com). Click on the “Create” button.
Your Google Analytics account is now linked to your WordPress site. All you need to do now is add the Google Analytics tracking code to your blog posts and pages.
To add the tracking code, click on the “Editor” tab in your Google Analytics account, and then under “Stats” click on the “Track Code” tab. In the “Code” field, enter the following code:
ga( ‘create’ , ‘UA-XXXXX-Y’ , ‘auto’ );
Where XXXX is your WordPress site’s domain name (e.g.com) and Y is the ID of the track you want to add (e. blogpost).
Click on the “Track” button to add the track to your blog post or page. You’ll now see the “Google Analytics” column in your blog post or page’s stats table.
Click on the “Replace” button in the “Code” field to enter the Google Analytics tracking code for a new post or page.
That’s it! You’re now tracking your blog posts and pages with Google Analytics. To learn more about Google Analytics and how it can help you track your website’s traffic, please visit Google’s website.