• I know there are a lot of different ways to add Google Analytics to a WP website.

    My question is, which way is considered the best, from a performance standpoint in regards to overall site speed.

    Plugin?
    Add theme feature?
    Add ga code manually within the theme files?

    Building a new site from scratch with the goal to squeeze every last ounce of speed I can find. Minify, Cache, Image Optimization, etc. I’m really trying to take it to the extreme on this project to see how much I can optimize for page speed. Using Vultr with Ubuntu 16.04 and MariaDB.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Minify the code itself because you shouldn’t need to edit it going forward. Then place it in your theme’s footer.php file right before the closing </body> tag. That’s the most ideal place for it to go. If you use the wp_footer(); function, place it after that so it’s loaded after all of the WordPress specific script includes as well.

    Thread Starter waterworks2

    (@waterworks2)

    Not sure if you read my post. I said I was going to minify, utilize cache, etc. I was merely asking which install method for g.analytics is the best from a performance standpoint. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding G. Analytics for best performance’ is closed to new replies.