I ran an SEO audit on my WP site and one of the recommendations was to "Implement an analytics tracking tool" so I figure instead of just adding any old plugin or adding the code to the page I would ask in terms of SEO and optimization, what is the best way to add google analytics to my WP site? If there is something better than Google Analytics I am open to ideas. I use WPRocket and I was thinking of going that route. Thanks in advance!
Try reading https://www.wpbeginner.com/beginners-guide/how-to-install-google-analytics-in-wordpress/#installga-wptheme for steps on how to install in WP without using a plugin. If you have a child theme, it is much better than using a plugin. Note the link is assuming you don't have a child theme, hence their recommendation to not use the method.
Also, since you're using WP Rocket, WPR don't expect WPR's local caching of the GA tags to work using the code that Google currently generates. Not a big deal, but you don't want to waste your energy trying to make something work, that must be coded differently.
Keep in mind that the more GA triggers you add, the slower your pages will load. So, if you're trying to keep your page speed super fast, make sure you limit GA triggers to only one's you are sure you need.