Add Google Analytics to WordPress

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 can setup this plugin. If you don't have an account, then you will need to set one up.

  1. Access your Google Analytics account and copy your tracking code snippit.
  2. Access your WordPress files via hosting or FTP. (cPanel / Plesk / Web Hosting / Managed WordPress)
  3. Navigate to the /wp-content/themes folder for your WordPress site.
  4. Open the folder for the theme you are currently using on your site.
  5. 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.

  6. Paste your tracking code snippit just before the following code.
    <?php wp_head();
  7. Save and upload the updated file.
  8. Visit your site so that traffic is recorded in your Google Analytics account.
  9. Check your Google Analytics reporting to confirm the file was correctly updated.

More info

Was This Article Helpful?
Thanks for your feedback. To speak with a customer service representative, please use the support phone number or chat option above.
Glad we helped! Anything more we can do for you?
Sorry about that. Tell us what was confusing or why the solution didn’t solve your problem.