Google's John Mueller said that your SEO is not impacted by the way you implement your analytics software. That is assuming you don't implement it in a way that blocks crawling and indexing, he added.
John said on Twitter "How you implement Analytics doesn't affect SEO at all. (assuming your Analytics doesn't block search crawling / indexing)."
Here are those tweets in context:
How you implement Analytics doesn't affect SEO at all. (assuming your Analytics doesn't block search crawling / indexing)
— 🐐 John 🐐 (@JohnMu) February 14, 2022
John Mueller said before that Google Analytics does not help or hurt your SEO and Google doesn't penalize for using analytics.
So don't worry and don't worry about it slowing down your site, the advantages of having analytics on your site, outweighs any speed issues that may result from it.
Forum discussion at Twitter.