Editor's note:
Thanks for visiting GA Tip of the Day. Please see current posts on the Cardinal Path blog.

Manually Add Google Analytics Tracking Code to WordPress

Google Analytics Tracking Code manually added to WordPress headerview at full size

You can manually add the Google Analytics code tracking to header.php in WordPress.

A recent post discussed free WordPress plugins for Google Analytics. Several of these plugins are easy to use and flexible, but another option for tracking WordPress is to add the Google Analytics tracking code directly into header.php.

To do this, you can open header.php in the editor and insert the tracking code just before the </head> tag. You can also add any customizations that you may need, such as for cross-domain tracking or Enhanced Link Attribution.

While a plugin may meet your needs in most cases, it’s good to have the flexibility of code editing when you might need it.

Please share this post:
Facebook Twitter Plusone Linkedin Email

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>