Liquid, JavaScript, themes, sales channels
I tried to see the unused code via coverage tool but after removing those codes site is crashing. In case of Eliminate render-blocking resources these three files are need to properly run the site .
This is PageFly - Free Landing Page Builder. I would love to provide my recommendations for your store based on 6 years of providing solutions for about 100.000 active Shopify merchants.
Regarding your concern about to solve the eliminate render-blocking and remove unused Javascript. First of all i need you to duplicate the theme file before make any changes to it.
Lets talk about eliminate render-blocking :
The CSS - JS needed to render the above-the-fold sections of the page should be delivered inline in the HTML(Critical CSS).
The browser only pulls in the stylesheets for the device type when you add media attributes to CSS links.
And we fix this by : add the attribute to the resource and make it load in the proper way
To add it you need to find: Online stores > Themes > Edit code and theme.liquid
About remove unnecessary JS, i think that is not possible because if you remove it the whole theme site function will break because that is unused in one page but useful in a lot of different pages.
If you feel my answer is helpful, like it or mark it as a solution. Let me know if you have any questions.
Best regards,
PageFly
i have tried the defer option but all the elements shown are critical thing. When i defer the glightbox.js, then the counter on the homepage is not working.
Hi @nikz35,
We have a few suggestions based on your query. Hope it will help you resolve the same.
<link rel=”preload” as=”style” href=”{{ ‘css_file.css ’ | asset_url }}”/>
and then add the CSS normally you do in Shopify:
<link rel=”stylesheet” href=”{{ ‘css_file.css ’ | asset_url }}”/>
For Javascript files, you can use async and defer attributes to the script tag to remove the issue.
<script src=”{{ ‘script_file.js ’ | asset_url }}” async></script>
<script src=”{{ ‘script_file.js ’ | asset_url }}” defer></script>
Using the above keywords ensures that the render-blocking issues are removed from the script files.
If you wish to remove unused javascript issues coming through the Facebook sales channel script and google tag manager, you need to hire a developer to help you with these problems.
Hope it gets resolved. Let us know if you need any other help.
All the best,
Team CedCommerce.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024