Adding a Google Analytics code to your WordPress site is very simple. Google Analytics is totally free analytics services that provide advanced analytics for Search Engine Optimization ( SEO) and Digital marketing purposes. You can access Google Analytics with just having a Google account. 74.6 million sites are powered by the WordPress. WordPress provides you blog, infographic, e-commerce, and portfolio website.
How to add Google Analytics code to a WordPress site
Add Google Analytics on your WordPress website by just adding a few ready-made lines in your theme or child theme functions.php file.
Step 1: Login to your favorite FTP client and connect it to your website.
Step 2: Now go to the “wp-content/themes/<your-theme or child-theme>/functions.php” and open it with a text editor.
Step 3: Copy the following code from line 2 to 24 and paste it bottom into your functions.php.
Step 4: Now change UA-XXXXXXXXX-X with your Google Analytic tracking ID and save the file 🙂