Thanks for getting in touch @tannakartikey. A users GA4 measurement ID is contained within a users Google tag. You can check this using the tagassistant.google.com service, where you’ll find your measurement ID (with a G-***
prefix) as part of a Google tag (with a GT-**
prefix). While it’s not possible to output only the G- prefix if using the Analytics module within Site Kit to insert your Analytics snippets, this doesn’t mean any additional JavaScript resources are requested.
If you wish, you can insert your Google Analytics snippet manually, or use Tag Manager to insert your GA4 snippet only. We have more information on how Site Kit works with the new Google tag added to the plugin website.
In relation to the “Reduce unused JavaScript” opportunity you’re seeing, this is normal and expected if you’re using any external JavaScript library, including Analytics or jQuery. Not each line of code from that library will be executed at any single time, resulting in this opportunity in PageSpeed Insights. It’s not an error, and it doesn’t directly impact performance. It’s just alerting you to the fact that some JavaScript resource that is requested, contains some code that is not used at the time of your performance scan. You’ll find out more on this by reviewing?this Lighthouse GitHub issue, with Lighthouse being the technology used to run PageSpeed Insights scores.
Let me know if you have any further questions with the above.