I found that the code that most affects the speed of my website is from Google. What should I do?

Solved

I found that the code that most affects the speed of my website is from Google. What should I do?

Shawn512
Shopify Partner
111 2 16
  • Reduce unused Javascript:
Google Tag Manager
Google CDN
Other Google APIs/SDKs
Shawn512_0-1696933673248.png

 

  • Reduce the impact of third-party code:Third-party code blocked the main thread for 930 ms
Google CDN
Google Tag Manager
Other Google APIs/SDKs
 
Shawn512_1-1696933704413.png

 

 

 

 

So, do I need to do sth? or I cant do nothing if I use GA4 or google ads for conversion tracking.
Thanks a lot.
Pet Travel Supplies Small Business
Accepted Solution (1)

GadgetBM
Shopify Partner
8 1 2

This is an accepted solution.

Hello! Try add this code to your theme.liquid

And avada apps is not very optimized.

 

    <link rel="preconnect" href="//googletagmanager.com" crossorigin>

    <link rel="preconnect" href="//www.google-analytics.com" crossorigin>

    <ink rel="preconnect" href="//www.gstatic.com" crossorigin>

Online Electronics Store
If I've helped you, feel free to give me a thumbs-up!
https://gadgetbm.com/

View solution in original post

Replies 8 (8)

GadgetBM
Shopify Partner
8 1 2

This is an accepted solution.

Hello! Try add this code to your theme.liquid

And avada apps is not very optimized.

 

    <link rel="preconnect" href="//googletagmanager.com" crossorigin>

    <link rel="preconnect" href="//www.google-analytics.com" crossorigin>

    <ink rel="preconnect" href="//www.gstatic.com" crossorigin>

Online Electronics Store
If I've helped you, feel free to give me a thumbs-up!
https://gadgetbm.com/
Shawn512
Shopify Partner
111 2 16

Wow!!!Thanks so much.

I will have a try!

Pet Travel Supplies Small Business
Shawn512
Shopify Partner
111 2 16

Hey,

Where should I add the code please?

Anywhere  between <head> and </head>

 

Thanks a lot

Pet Travel Supplies Small Business
GadgetBM
Shopify Partner
8 1 2

See on google but the best is preconnect first

Online Electronics Store
If I've helped you, feel free to give me a thumbs-up!
https://gadgetbm.com/
adrott89
Visitor
1 0 1

Hi, where did you enter the code? Anywhere between <head> and </head>? Thanks

SamuelTBeslogic
Tourist
8 0 0

Similarly for us, gtag (Google Tag Manager) is the biggest third party offender in terms of blocking execution (taking about half a second) as reported by PageSpeed.
I downloaded the theme to be sure and there's no reference in code.
We have no Custom Pixels.
We only set it up through the "Google & Youtube" Sales Channel.

Denis_B
Excursionist
28 0 44

Will this fix still work - my developer is doubtful?

 

Denis

SamuelTBeslogic
Tourist
8 0 0

Hello Denis. I think you might be misinterpreting my comment. I am not offering any fix or workaround. I am simply confirming the issue with additional context and information.