Personalized checkout and custom promotions with Shopify Scripts
Hi,
I've been trying to optimize my site and came across the following error according to google lighthouse:
I have <meta> on the top of my <head> in my theme.liquid. When inspecting my site, I see that the <meta> is actually in the <body>. I've also realized that there is a <script> before my <head>. How do I fix this?
Is <script> running before my <head> because I have <link rel="preconnect, dns-prefetch, or preload"> in my <head>?
website: https://feedmomandme.com/
The issue you're encountering with the <meta name="viewport"> tag being placed in the <body> instead of the <head> could be related to how your theme is structured and how the scripts are loaded.
Here are steps to troubleshoot and potentially fix the issue:
Move <meta name="viewport"> to the Correct Location:
Check Theme Files:
Evaluate Script Placement:
Preconnect, DNS-prefetch, or Preload:
Check for Theme or App Scripts:
Inspect Browser Console:
Testing:
Remember to make changes in a controlled environment or during low-traffic periods to avoid any disruptions to your live site. If you're unsure about specific modifications, consider reaching out to your theme developer or Shopify support for assistance.
Without direct access to your site's code, it's challenging to provide a precise solution, but these steps should guide you in troubleshooting and fixing the issue.
Hi @Mavi90 ,
You can try adding my code below <head> element
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0">
Hope my solution works perfectly for you!
Best regards,
Oliver | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024