How do I add Google Analytics to WordPress

To add Google Analytics Code to WordPress, you can follow two ways:

A. Insert into Header.php

Step 1. Go to Appereance -> Editor

add-google-analytic-to-wordpress-1

Step 2. Select Header.php

add-google-analytic-to-wordpress-2-min-1024x425

Step 3. Insert the Google Analytics code above the </head>

add-google-analytic-to-wordpress-3-min

Step 4. Update File

Notes:

You should do this in Child Theme.

If Child Theme does not have header.php file. Please copy the header.php from the Parent theme to your Child Theme, then add the Google Analytics Code to the Child Theme.

B. Use the Insert Headers and Footers plugin

Step 1. Install Insert Headers and Footers Plugin

add-google-analytic-to-wordpress-4-min-1024x342-min

Step 2. Go to Settings –> Insert Headers and Footers

add-google-analytic-to-wordpress-5-min

Step 3. Paste Google Analytics Tracking Code into Scripts in Header

add-google-analytic-to-wordpress-6-min

Step 4. Save. Done

Share this post:

Leave a Comment