• Resolved tannakartikey

    (@tannakartikey)


    I am getting “Reduce unused JavaScript” error in PageSpeed while using Sitekit. Sitekit loads the tag starting with “GT-” instead of “G-“.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    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.

    Plugin Support James Osborne

    (@jamesosborne)

    One other thing I didn’t mention regarding unused JavaScript @tannakartikey, is that some third party plugins, such as optimization plugins can reformat your JavaScript via minification. Alternatively if you’re using AMP, you’re unlikely to encounter such opportunities with some JavaScript restrictions along with different specifications for AMP analytics.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to instruct SiteKit to use Measurement ID and not Google Tag?’ is closed to new replies.