{"id":7226,"date":"2024-10-29T18:49:26","date_gmt":"2024-10-29T18:49:26","guid":{"rendered":"https:\/\/impulsebyte.com\/blogs\/?p=7226"},"modified":"2024-11-06T06:09:19","modified_gmt":"2024-11-06T06:09:19","slug":"shopify-websites-page-speed-using-yett","status":"publish","type":"post","link":"https:\/\/impulsebyte.com\/blogs\/shopify\/shopify-websites-page-speed-using-yett\/","title":{"rendered":"Shopify Website&#8217;s Page Speed Using Yett"},"content":{"rendered":"<h3>Why it&#8217;s important to have good Page Speed?<\/h3>\n<p>As e-commerce businesses grow, ensuring that your website is fast and responsive is crucial for providing a seamless user experience. Slow-loading pages can lead to high bounce rates and lost sales. One effective tool for optimizing page speed on your Shopify store is <strong>Yett<\/strong>, a JavaScript library that helps control the loading of third-party scripts. Here\u2019s a step-by-step guide on how to implement Yett to enhance your Shopify site\u2019s performance.<\/p>\n<h3>1. Install Yett on Your Shopify Theme<\/h3>\n<p>To get started with Yett, you need to install it in your Shopify theme. Follow these simple steps:<\/p>\n<ul>\n<li><strong>Log in to your Shopify Admin Panel<\/strong> and navigate to <strong>Online Store &gt; Themes<\/strong>.<\/li>\n<li>Click on <strong>Edit Code<\/strong> for your active theme.<\/li>\n<li>Open the <code>theme.liquid<\/code> file located in the <strong>Layout<\/strong> folder.<\/li>\n<li>Add the Yett library by pasting the following code into the <code>&lt;head&gt;<\/code> section, before any other scripts:<\/li>\n<\/ul>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;script src=&quot;https:\/\/cdn.jsdelivr.net\/npm\/yett@0.1.5\/dist\/yett.min.js&quot;&gt;&lt;\/script&gt;\r\n<\/pre>\n<h3>2. Identify and Block Specific Third-Party Scripts<\/h3>\n<p>Next, identify the third-party scripts that might be slowing down your website. Common culprits include tracking scripts, social media widgets, and advertising networks. Use Yett to block these scripts initially:<\/p>\n<ul>\n<li>Still in your <code>theme.liquid<\/code> file, add the following code inside <code>&lt;script&gt;<\/code> tags:<\/li>\n<\/ul>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;script&gt;\r\nyett.block(&#x5B;'facebook.com', 'google-analytics.com', 'hotjar.com']);\r\n&lt;\/script&gt;\r\n<\/pre>\n<ul>\n<li>Replace the domains in the array with those of the scripts you wish to block initially.<\/li>\n<\/ul>\n<h3>3. Defer Script Loading Based on User Interaction<\/h3>\n<p>One of Yett\u2019s powerful features is the ability to defer the loading of scripts until users interact with your website. This can significantly improve initial load times. Here\u2019s how to implement it:<\/p>\n<ul>\n<li>To unblock specific scripts based on user interaction, add the following code:<\/li>\n<\/ul>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;script&gt;\r\nwindow.addEventListener('scroll', function() {\r\nyett.unblock('facebook.com');\r\nyett.unblock('google-analytics.com');\r\n}, { once: true });\r\n&lt;\/script&gt;\r\n<\/pre>\n<ul>\n<li>This code will ensure that Facebook and Google Analytics scripts load only after the user scrolls, reducing the initial load impact.<\/li>\n<\/ul>\n<h3>4. Test and Fine-Tune Script Blocking and Unblocking<\/h3>\n<p>Once you\u2019ve set up Yett, it\u2019s essential to test your website\u2019s performance. Use tools like <strong>Google PageSpeed Insights<\/strong> or <strong>GTmetrix<\/strong> to analyze your Shopify site\u2019s speed before and after implementing Yett. This will help you identify if any critical scripts are blocked and need to be unblocked earlier in the loading process.<\/p>\n<h3>5. Troubleshoot and Optimize Further<\/h3>\n<p>As you fine-tune your Yett implementation, be cautious about blocking essential scripts necessary for your Shopify site\u2019s functionality. Adjust your script blocking and unblocking settings based on user interactions to maintain a balance between performance and essential features.<\/p>\n<h3>Conclusion<\/h3>\n<p>Using Yett to manage your third-party scripts is a practical approach to optimizing your Shopify website\u2019s page speed. By implementing these steps, you\u2019ll provide a faster and more enjoyable shopping experience for your customers, ultimately leading to increased conversions and sales. Don\u2019t forget to regularly test your website\u2019s speed and make adjustments as needed!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why it&#8217;s important to have good Page Speed? As e-commerce businesses grow, ensuring that your website is fast and responsive is crucial for providing a seamless user experience. Slow-loading pages &hellip; <a title=\"Shopify Website&#8217;s Page Speed Using Yett\" class=\"hm-read-more\" href=\"https:\/\/impulsebyte.com\/blogs\/shopify\/shopify-websites-page-speed-using-yett\/\"><span class=\"screen-reader-text\">Shopify Website&#8217;s Page Speed Using Yett<\/span>Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":7236,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-7226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shopify"],"_links":{"self":[{"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/posts\/7226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/comments?post=7226"}],"version-history":[{"count":6,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/posts\/7226\/revisions"}],"predecessor-version":[{"id":7234,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/posts\/7226\/revisions\/7234"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/media\/7236"}],"wp:attachment":[{"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/media?parent=7226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/categories?post=7226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/tags?post=7226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}