WPCode is designed to simplify and manage custom code snippets, reducing reliance on plugins and inevitably reducing site bloating.
But first, go to your Google Analytics dashboard and select Go To Data Streams. Select the data stream you want and hit View Tag Instructions.
Here, copy the code under the Install Manually tab.
Now, back on your WordPress dashboard, install and activate the WPCode plugin through the plugin repository in your WordPress dashboard.
Go to Code Snippets » Headers & Footers in your WordPress dashboard.
Next, in the Header section, paste the tracking code you copied earlier.
Make sure you hit the Save Changes button and that’s it.
Next, we’ll show you how to connect WordPress to Google Analytics manually without any plugin.