<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Wojciech Kałużny on Medium]]></title>
        <description><![CDATA[Stories by Wojciech Kałużny on Medium]]></description>
        <link>https://medium.com/@mrkaluzny?source=rss-3c0fb3dd5956------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*3L60fnrrAxRlqd5LH6890g.jpeg</url>
            <title>Stories by Wojciech Kałużny on Medium</title>
            <link>https://medium.com/@mrkaluzny?source=rss-3c0fb3dd5956------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:17:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrkaluzny/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[3 Data-Driven Levers to Scale Your eCommerce Store]]></title>
            <link>https://mrkaluzny.medium.com/3-data-driven-levers-to-scale-your-ecommerce-store-41588fdf16f4?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/41588fdf16f4</guid>
            <category><![CDATA[experiment]]></category>
            <category><![CDATA[conversion-optimization]]></category>
            <category><![CDATA[shopify]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 12:00:54 GMT</pubDate>
            <atom:updated>2025-11-25T12:00:54.475Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The era of “build it and they will come” is long dead. In today’s hyper-competitive eCommerce landscape, the winners aren’t the ones with the prettiest logos — they are the ones who treat their storefronts like a laboratory.</strong></p><p>If you run an online store, you probably spend a significant chunk of your budget on acquisition. You pay for eyes on your page via Meta ads, Google keywords, or influencer partnerships. But what happens once those potential customers arrive?</p><p>Far too many founders rely on “gut feeling” to convert that traffic. They pick a price that “sounds right,” change button colors because they “pop,” and measure success solely by the final cha-ching of a sale.</p><p>To truly scale, you need to move from intuition to data. You need to stop guessing and start optimizing. Here are three underutilized levers you can pull today to unlock hidden revenue in your existing traffic.</p><h3>1. The Price Tag is a Variable, Not a Constant</h3><p>Pricing is often treated as a static decision. You calculate your COGS (Cost of Goods Sold), slap on a margin that keeps the lights on, and never touch it again.</p><p>This is a mistake. Pricing is one of the most powerful psychological triggers in marketing, yet it is rarely tested.</p><p>Is your product perceived as “too cheap” to be high quality? Or are you missing out on volume because you’re $5 above the psychological threshold of your target demographic? You cannot answer these questions without <a href="https://cleancommit.io/blog/pricing-experiments/">pricing experiments</a>.</p><p><a href="https://cleancommit.io/blog/pricing-experiments/">Testing different price points allows you to find the elasticity of your demand</a>. You might discover that raising your price by 20% lowers conversion slightly but increases overall profitability significantly. Conversely, a lower entry point might increase volume enough to skyrocket your Lifetime Value (LTV).</p><p>If you aren’t sure where to start, you need to look at the methodology behind <a href="https://cleancommit.io/blog/pricing-experiments/"><strong>running effective pricing experiments</strong></a>. It’s not just about changing numbers; it’s about understanding the value perception of your brand.</p><h3>2. Stop Ignoring the “Almost” Customers</h3><p>In eCommerce, we are often obsessed with the macro-conversion: the purchase. It’s the metric that pays the bills, so it gets all the glory.</p><p>But a purchase is rarely a spontaneous event. It is the culmination of a series of smaller yeses. These are called <a href="https://cleancommit.io/blog/micro-conversions/"><strong>micro-conversions</strong></a>.</p><p>A <a href="https://cleancommit.io/blog/micro-conversions/">micro-conversion is any small step a user takes toward the final goal.</a> It could be:</p><ul><li>Viewing a product video.</li><li>Adding an item to a wishlist.</li><li>Signing up for a newsletter.</li><li>Clicking “Read More” on a description.</li></ul><p>If you only optimize for the sale, you are trying to run a marathon by only focusing on the finish line while ignoring the 26 miles before it. By tracking and optimizing these smaller actions, you build a healthier funnel. If you can get 10% more people to view a product video, and video viewers convert at 2x the rate of non-viewers, you have just engineered growth without touching your ad spend.</p><p>To get a better grasp on which metrics actually move the needle, dive into this guide on <a href="https://cleancommit.io/blog/micro-conversions/"><strong>tracking and optimizing micro-conversions</strong></a>.</p><h3>3. Adopt the Scientific Method</h3><p>Once you decide to test your pricing or optimize your micro-conversions, how do you actually <em>do</em> it?</p><p>You cannot simply change your homepage today and compare it to sales from last week. That data is flawed — external factors like the day of the week, holidays, or ad performance will skew your results.</p><p>You need <a href="https://cleancommit.io/blog/how-to-ab-test-ecommerce-store/"><strong>A/B testing</strong> (or split testing)</a>.</p><p>A/B testing allows you to show Version A to half your audience and Version B to the other half simultaneously. It is the only way to statistically prove that a change caused an improvement.</p><p>However, <a href="https://cleancommit.io/blog/how-to-ab-test-ecommerce-store/">A/B testing is easy to botch</a>. If you test too many things at once, or if you don’t run the test long enough to reach statistical significance, you might end up making decisions based on noise rather than signal.</p><p>For a walkthrough on the technical setup and strategy, check out this resource on <a href="https://cleancommit.io/blog/how-to-ab-test-ecommerce-store/"><strong>how to properly A/B test an eCommerce store</strong></a>.</p><h3>The Takeaway</h3><p>Growth isn’t magic. It’s a process.</p><p>The brands that will dominate the next decade of eCommerce are the ones that are willing to be wrong. They are the ones willing to test a hypothesis, analyze the micro-steps users take, and let the data dictate the strategy.</p><p>Stop leaving money on the table. Pick one variable this week — whether it’s your pricing or a step in your checkout flow — and put it to the test.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41588fdf16f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micro & Macro Conversions in ecommerce]]></title>
            <link>https://mrkaluzny.medium.com/micro-macro-conversions-in-ecommerce-97dde780d5b6?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/97dde780d5b6</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[shopify]]></category>
            <category><![CDATA[conversion-optimization]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 11:21:52 GMT</pubDate>
            <atom:updated>2025-11-17T11:23:05.400Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of ecommerce, it’s easy to get tunnel vision. We refresh our Shopify dashboard, fixated on one thing: the sale. That final, glorious macro conversion. But here’s the hard truth: <a href="https://www.ruleranalytics.com/blog/insight/conversion-rate-by-industry/?ref=blog.cleancommit.io#organic-search-conversion-rates">over 98% of visitors to your store won’t buy on their first visit.</a></p><p>If you <em>only</em> focus on the final sale, you’re blind to the entire customer journey. You’re missing the clues, the signals of intent, and the small steps that users take <em>before</em> they’re ready to purchase.</p><p>This is where the <a href="https://cleancommit.io/blog/micro-conversions/#micro-conversions">micro conversion</a> comes in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*smPoIHf3cMYQdtpt.jpg" /></figure><p>A micro conversion is a small, measurable action a user takes on your website that indicates interest and moves them closer to your main goal. Think of them as the trail of breadcrumbs leading to the final purchase.</p><p>Understanding, tracking, and optimizing for these actions is the single most effective way to understand your customer, fix your funnel, and ultimately drive more of those all-important <a href="https://support.optimizely.com/hc/en-us/articles/4410288871565-Track-macro-and-micro-conversion-events?ref=blog.cleancommit.io#01H8Q3WJ0D4NV545FQ20Q77EQH">macro conversions</a>.</p><p>To effectively optimize your store, you must first distinguish between your primary goal (macro conversions) and the smaller actions (micro conversions) that lead to it.</p><h3>Macro conversions</h3><p><a href="https://cleancommit.io/blog/conversion-rate-optimization-for-growth-oriented-shopify-stores/?ref=blog.cleancommit.io#what-is-conversion-rate-and-how-to-calculate-it">Conversion rates</a> are key performance indicators (KPIs) used to measure the success of your store. They track how often your desired user actions (i.e., conversions) happen.</p><p>The most impactful of these are known as macro conversions. These are the primary actions that directly align with your site’s main business goals.</p><p>For a Shopify store, macro conversions typically fall into two main categories:</p><ol><li>Completed Purchase: <a href="https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed?ref=blog.cleancommit.io">Shopify tracks this event as </a><a href="https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed?ref=blog.cleancommit.io">checkout_completed</a>. This is the ultimate goal for most ecommerce stores. It&#39;s the &quot;mission accomplished&quot; moment that directly generates revenue and fulfills your primary business objective.</li><li>High-Value Lead Generation: Not all visitors are ready to buy <em>now</em>. Therefore, another primary goal is to convert an anonymous visitor into an <em>identifiable prospect</em>. This means capturing high-intent contact information.</li></ol><ul><li>Email Signup (e.g., joining your newsletter, often in exchange for a discount)</li><li>SMS Signup (e.g., opting in for text alerts and exclusive deals)</li></ul><p>While a purchase is a <em>revenue</em> goal, a newsletter or SMS signup is a <em>lead</em> goal. Both can be considered macro conversions because they turn a window shopper into a tangible asset — <a href="https://www.linkedin.com/pulse/building-activation-funnel-b2c-platforms-damilola-robert-6y6sf/?ref=blog.cleancommit.io">a lead you now own and can market to directly</a>.</p><p>Defining your macro conversions is the first step. For your Shopify store, you will likely have one ultimate macro conversion (the sale) and one or two critical secondary macro conversions (email/SMS signup).</p><h3>Defining and Tracking Your Macro Conversions in Shopify</h3><p>Defining your macro conversions begins with your overarching business goals. Are you focused purely on immediate revenue, or is building a long-term customer list just as important?</p><p>For your Shopify store, assess how the site contributes to these goals:</p><ul><li><strong>Goal</strong>: Generate direct revenue.</li><li>User Action: A user must successfully complete the checkout process.</li><li><strong>Goal</strong>: Grow your marketing list for future revenue.</li><li>User Action: A user must submit their email via a newsletter form or pop-up.</li></ul><p>Once you have defined these necessary user actions, your team must choose the right metrics and <a href="https://cleancommit.io/blog/27-shopify-conversion-rate-optimization-tools-that-work/?ref=blog.cleancommit.io#analytics-tools">analytics tools to track them</a>. This allows you to measure success and see if your store is actually achieving its goals.</p><p>Your <a href="https://cleancommit.io/blog/27-shopify-conversion-rate-optimization-tools-that-work/?ref=blog.cleancommit.io#shopify-analytics-your-baseline">built-in Shopify Analytics</a> is the perfect place to start. You can set up and monitor your conversion rates to see exactly how many users are taking these key actions. For a step-by-step guide on configuring this, see our article on <a href="https://cleancommit.io/blog/how-to-use-rybbit-with-shopify-analytics/?ref=blog.cleancommit.io">how to use Rybbit with Shopify Analytics</a> to get your tracking set up correctly.</p><h3>Micro Conversions</h3><p><a href="https://www.optimonk.com/micro-conversions/?ref=blog.cleancommit.io#elementor-toc__heading-anchor-1">Micro conversions</a> are smaller, measurable actions that users take, indicating they are moving <em>towards</em> your macro goal. They are not the final sale, but they are crucial signals of interest and engagement.</p><p>The problem is that for some Shopify stores, customers might go through a long cycle of consideration and research before they <em>eventually</em> decide to make a purchase. Because of this long consideration phase, your macro conversion rates may be slow to change. This causes a challenge to asses the impact of incremental improvements made to your store if you’re only waiting for the final sale data, which might take weeks to show a clear trend.</p><p>This is precisely why micro conversions are so critical. They are the solution to this measurement problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SniAxQRhzZXkNYdf.jpg" /></figure><p>We can split micro conversions into two distinct categories:</p><ol><li>Process milestones — micro conversions on the direct path to your macro conversion</li><li>Secondary actions — desirable micro conversions that show interest or engagement but are not on the direct path to <a href="https://cleancommit.io/blog/conversion-rate-optimization-for-growth-oriented-shopify-stores/?ref=blog.cleancommit.io#what-is-a-conversion">macro conversion</a>.</li></ol><h3>Process Milestones</h3><p>Process milestones are the critical, sequential steps users take on the <em>direct path</em> to your macro conversion. For a Shopify store, this is your primary sales funnel. Think of it as the “must-take” journey from discovery to purchase.</p><p>The main reason to track these is to identify exactly where users are dropping off. They allow you to track <em>how</em> users are moving (or <em>failing</em> to move) toward a sale.</p><p>For a Shopify Store these steps may include:</p><ul><li>Viewing a product page</li><li>Viewing a collection page</li><li>Using filters or search to refine results</li><li>Adding a product to the cart</li><li>Adding upsells to the cart</li><li>Viewing upsells</li><li>Initiating the checkout process</li><li>Reaching the “payment” stage of checkout</li></ul><p>Tracking these milestones is critical for identifying where to focus your optimization efforts on the store. If more customers will add a product to cart, in theory, more should finalize with the sale.</p><h4>How to Define Your Process micro conversions?</h4><p>To define these for your store, map out the most common, linear path a customer takes to buy something.</p><p>Ask yourself: <em>What are the non-negotiable steps to a sale?</em></p><p>For almost every Shopify store, that journey looks like this:</p><ol><li><strong>View a Product Page</strong>: The user has moved from a homepage, collection, or ad to show interest in a specific item.</li><li><strong>Add to Cart</strong>: This is a major signal of intent. The user has said, “I want this.”</li><li><strong>Initiate Checkout</strong>: The user has clicked the “Checkout” button from the cart or a pop-up.</li><li><strong>Complete checkout steps</strong>: The user has successfully entered their shipping information and is now one step away from buying.</li></ol><p>But this list is just the high-level outline. The <em>real</em> analysis comes from mapping the necessary tasks a user <em>must</em> complete to get from one milestone to the next.</p><p>This is where you find the friction. Ask these questions about your store:</p><p>To get from ‘View Product’ → ‘Add to Cart’:</p><ul><li><strong>What is functionally required?</strong> Does the user <em>have</em> to select a size? A color? A bundle configuration? A quantity?</li><li><strong>Where is the friction?</strong> Are these options clear? Do variants show “Sold Out” only <em>after</em> a user clicks? Is the quantity selector hidden?</li><li><strong>Is this step unnecessary?</strong> Does the quantity <em>need</em> to be set here, or could it default to ‘1’? By forcing this choice, are you creating a barrier?</li></ul><p>To get from ‘Add to Cart’ → ‘Initiate Checkout’:</p><ul><li><strong>What is functionally required?</strong> What happens <em>immediately</em> after a user clicks “Add to Cart”? Do they have to interact with a slide-out cart? Do they have to find the tiny cart icon in the header? Are they taken to a full cart page?</li><li><strong>Where is the friction?</strong> If a slide-out cart appears, is the “Checkout” button clear, or is it hidden below upsells and a “Continue Shopping” button?</li><li><strong>Is this step unnecessary?</strong> Does the user <em>need</em> to go to a full cart page, or could a slide-out cart take them directly to checkout? Are you forcing them to review their cart when they’re already decided?</li></ul><p>To get from ‘Initiate Checkout’ → ‘Reach Payment’:</p><ul><li><strong>What is functionally required?</strong> This is your <a href="https://cleancommit.io/blog/ecommerce-sales-funnel-optimization-seven-figure-guide/?ref=blog.cleancommit.io#stage-4-action-checkout-optimization">core Shopify checkout funnel</a>. What fields are mandatory? Email, shipping address, shipping method selection.</li><li><strong>Where is the friction?</strong> Does your address auto-complete work well? Do you <em>force</em> users to create an account (a classic “unnecessary step” that kills conversions)? Are your shipping options and costs presented clearly, or are they a late-stage shock?</li><li><strong>Is this step unnecessary?</strong> Are you asking for a phone number when it’s not required for shipping? Are you splitting the process into too many separate “pages” or steps?</li></ul><p>By asking “What is <em>required</em>?” at each stage, you move from vague analysis to a concrete, functional conversion rate optimization audit of your store. You can spot a confusing variant selector, a hidden checkout button, or an unnecessary form field that causes friction and is costing you sales.</p><h3>Secondary Actions</h3><p>These are desirable micro conversions that show interest and engagement, but they are not on the direct, linear path to an immediate purchase.</p><p>Their purpose is to build your relationship with the customer, gather insights about their intent, and nurture them for a <em>future</em> macro conversion. These are often “secondary features” on your site, but optimizing them is just as critical as <a href="https://cleancommit.io/blog/ecommerce-sales-funnel-optimization-seven-figure-guide/?ref=blog.cleancommit.io#the-traditional-ecommerce-funnel-fast-overview">optimizing your main sales funnel</a>.</p><p>These actions help you build your audience and nurture leads who aren’t ready to buy today.</p><p>Shopify examples include:</p><ul><li>Subscribing to your newsletter (now you own the relationship)</li><li>Creating a customer account</li><li>Adding an item to a “Wishlist”</li><li>Leaving a product review or asking a question</li><li>Watching an embedded product video</li><li>Sharing a product on social media</li></ul><p>By understanding this framework, you can stop asking “Why aren’t people buying?” and start asking the right questions: “Where are they stopping on the path to purchase (Process Milestones)?” and “How can we better engage those not ready to buy (Secondary Actions)?”</p><h4>How to Use Secondary Actions to Assess Your Store’s Features?</h4><p>Secondary actions are highly contextual and will vary based on your store’s specific design and features.</p><p>The real power of tracking them is not just to count them, but to use them as a report card for your site’s functionality.</p><p>Instead of just <em>having</em> a feature like a ‘Wishlist’ or ‘Site Search,’ you should be asking if it’s actually <em>working</em> and helping users. Tracking these micro conversions allows you to answer these crucial questions.</p><h4>Assessing Your Site Search</h4><p>Your site search bar isn’t just a tool; it’s your customers telling you <em>exactly</em> what they want in their own words.</p><ul><li>What are customers searching for? This is a goldmine. Are they searching for ‘blue dress’ (and you sell them)? Or are they searching for ‘red shoes’ (and you don’t stock them)? This data gives you direct insight into product demand and customer intent.</li><li>What results are they getting? This is the most critical friction point. You <em>must</em> track your “0 results” searches. When a user searches for “raincoat” and gets a blank page, they are very likely to leave your site.</li><li>Do they click on the results? This measures the <em>relevance</em> of your search. If 100 people search for ‘blue dress’ but only 5 click a result, it means your search results are bad. They might be showing irrelevant items, or the results page is poorly designed (e.g., no product images or prices).</li></ul><h4>Assessing Your Filtering &amp; Sorting</h4><p>On your collection pages, filters are the primary tool you give users to reduce overwhelm and find their perfect product.</p><ul><li>Are customers using filtering? Start here. If you have a “Filter By” button but only 1% of users click it, it’s either not needed or (more likely) poorly designed, hidden, or hard to see — especially on mobile.</li><li>How are they using it? Which filters are the <em>most</em> popular? If Filter by Size is used 80% of the time, it should be the first and most prominent filter. If Filter by Brand is never used, it&#39;s just visual clutter and you should consider removing it to simplify the interface.</li></ul><h4>Assessing Your Wishlist</h4><p>A wishlist (which usually requires a Shopify App) can be a powerful sales tool… or a product graveyard.</p><ul><li>Are customers adding products to their wishlist? This first step measures the feature’s visibility. Is the “Add to Wishlist” button clear (e.g., a “❤️” icon) and easy to find? A key friction point to check: Do you <em>force</em> users to create an account to save a wishlist? If so, you’re losing almost all of those users. A “guest wishlist” is a much better solution.</li><li>Are they buying the items, or is the wishlist just abandoned? This is the <em>real</em> KPI. You must track add_to_cart_FROM_wishlist. If items just sit there forever, your wishlist is a passive &quot;save for later&quot; button. If you use it to send automated &quot;low in stock&quot; or &quot;on sale&quot; alerts for their saved items, it becomes an active, <a href="https://cleancommit.io/blog/ecommerce-sales-funnel-optimization-seven-figure-guide/?ref=blog.cleancommit.io#stage-3-desire-and-decision-bottom-of-funnel">high-converting sales funnel</a>.</li></ul><h3>Why Every Shopify Store Must Track Micro Conversions?</h3><p>If you’re only tracking your macro conversions (like sales), you’re essentially operating in the dark. You know <em>if</em> you made a sale, but you have no idea <a href="https://www.ruleranalytics.com/blog/insight/conversion-rate-by-industry/?ref=blog.cleancommit.io#organic-search-conversion-rates"><em>why</em> you’re losing the 98% of other visitors</a>.</p><p>Tracking micro conversions illuminates the entire customer journey. It’s the only way to move from <em>guessing</em> what’s wrong to <em>knowing</em> what to fix.</p><p>Here’s exactly what tracking micro conversions allows you to do:</p><ol><li>Pinpoint Your Exact Funnel Leaks This is the most critical benefit. By tracking your process milestones, you can see where the drop-off is. A high add_to_cart rate but a low initiate_checkout rate tells you the problem <em>isn&#39;t</em> your product page; it&#39;s your cart page. You&#39;ve found the leak, and as we&#39;ll discuss, you now have a clear target for optimization.</li><li>Test Your Improvements with Confidence Remember how we said macro conversions are “slow to change”? This makes <a href="https://cleancommit.io/blog/how-to-ab-test-ecommerce-store/?ref=blog.cleancommit.io#how-to-ab-test-your-e-commerce-store-a-6-step-process">running A/B tests</a> difficult. Micro conversions solve this. Instead of running a test on your product page and waiting weeks to see if <em>sales</em> (a macro) changed, you can measure the impact on your add_to_cart micro conversion. You&#39;ll get a clear, statistically significant winner in days, not months.</li><li>Understand the “Why” Behind the “What” Analytics tells you <em>what</em> page users left from. Tracking secondary actions helps you understand <em>why</em>. Are users watching your product videos? Are they clicking the “size guide”? Are they using your “wishlist” feature? As we’ll cover in the next section, combining this data with the right tools gives you a complete picture of user behavior.</li><li>Create Smarter Retargeting &amp; Personalization Tracking micro conversions allows for powerful audience segmentation. You can (and should) create a Facebook or Google retargeting audience for users who add_to_cart (high-intent) that is completely different from one for users who just view_a_blog_post (lower-intent). This makes your ad spend dramatically more efficient.</li></ol><h3>How to Track Macro and Micro Conversions in Shopify?</h3><p>You don’t need to be a data scientist to start tracking these. You can get 90% of the way there with tools you already use.</p><h3>Shopify Analytics — Built In tracking</h3><p>Your <a href="https://cleancommit.io/blog/27-shopify-conversion-rate-optimization-tools-that-work/?ref=blog.cleancommit.io#shopify-analytics-your-baseline">built-in Shopify Analytics dashboard</a> is already tracking macro conversions and key micro conversion process milestones.</p><p>Go to Analytics &gt; Reports and look at your “Online store conversion rate.” It shows you the funnel from “Added to cart” to “Reached checkout” to “Sessions converted.” This is your starting point for finding leaks.</p><h3>Google Analytics (GA4) or alternative tools</h3><p><a href="https://cleancommit.io/blog/27-shopify-conversion-rate-optimization-tools-that-work/?ref=blog.cleancommit.io#google-analyticsthe-ol-reliable">Google Analytics is the most-common go-to solution</a> for tracking <em>all</em> your micro conversions. Shopify integration can send basic data (like page views and purchases) automatically, but you’ll want to set up specific <em>events</em> for your key micro conversions. In GA4, you can mark events like add_to_cart, begin_checkout, and sign_up_for_newsletter as &quot;Conversion events&quot; to see them in your main reports.</p><p>Alternatively you can use <a href="https://cleancommit.io/blog/how-to-use-rybbit-with-shopify-analytics/?ref=blog.cleancommit.io#what-youre-tracking-automatically">Rybbit to track micro conversions</a>, or <a href="https://cleancommit.io/blog/27-shopify-conversion-rate-optimization-tools-that-work/?ref=blog.cleancommit.io#mixpanel">MixPanel</a> to get better user-experience for working with these events.</p><h3>Heatmaps &amp; Session Recording Tools</h3><p>Tools like <a href="https://cleancommit.io/blog/27-shopify-conversion-rate-optimization-tools-that-work/?ref=blog.cleancommit.io#hotjar">Hotjar</a> or <a href="https://cleancommit.io/blog/27-shopify-conversion-rate-optimization-tools-that-work/?ref=blog.cleancommit.io#microsoft-clarity-our-go-to-tool">Microsoft Clarity</a> (which is 100% free) are the <em>why</em> behind your data. Google Analytics tells you <em>what</em> page users left from; a session recording <em>shows</em> you what they did right before they left. You can watch them rage-click a broken button or get confused by your shipping options.</p><h3>How to Use Micro Conversion Data to Grow Your Store?</h3><p>Data is useless unless you act on it. Now that you can identify your process milestones and secondary actions, you can use that data to make surgical, high-impact improvements.</p><p>Here is a practical framework for turning your new insights into action.</p><h3>Acting on Process Milestone Data (Fixing Your Funnel)</h3><p>This is about optimizing the direct path to purchase. Your analysis of process milestones helped you identify <em>where</em> the leaks are.</p><p>Apply deeper questions about functional friction to better asses <em>what</em> to fix.</p><p>Problem: Your analytics show a high add_to_cart rate, but a huge drop-off before the initiate_checkout micro conversion.</p><ul><li>Analysis (Using Your Knowledge): Ask, <em>“What is functionally required to get from cart to checkout?”</em> You realize your shipping cost is a late-stage surprise and the “Checkout” button is below the fold.</li><li>Action: Redesign your cart page (or slide-out cart) to show a shipping estimator <em>before</em> the checkout button and make the CTA bold, clear, and high on the page.</li></ul><p>Problem: Your view_product_page rate is high, but your add_to_cart rate is terrible.</p><ul><li>New Analysis (Using Your Knowledge): You ask, “What is functionally required to add to cart?” You see that users <em>must</em> select a size <em>and</em> a color, but the “Sold Out” status only appears <em>after</em> they click. You’ve found the friction.</li><li>Action: Add micro conversion tracking to selectors, validate that this is a problem. If it is fix your variant selector. Show “Sold Out” status on page load (don’t make them click!). Make the most common size the default selection.</li></ul><h3>Acting on Secondary Action Data (Optimizing Your Features)</h3><p>This is about optimizing the “relationship-building” actions and site features you just assessed. These actions build your audience and make your site easier to use, leading to future sales.</p><p>Problem: Your “Site Search” assessment shows that 40% of all searches on your store get “0 results.”</p><ul><li>Analysis: This is a massive friction point and a dead-end for users. You are losing potential sales.</li><li>Action:</li></ul><ol><li>Immediately configure your search so the “0 results” page <em>shows</em> “Best Sellers” collection instead of a blank page.</li><li>Review the top 10 “0 results” search terms. If people are constantly searching for “red shoes” and you don’t have them, you have just identified a clear product/market demand or you just have to update the search configuration to merge “red” with “rose”, “ruby”, “cherry” etc.</li></ol><ul><li>Problem: A key blog post gets 10,000 views a month, but your newsletter_signup (a secondary macro conversion) rate from that page is almost zero.</li><li>Analysis: The CTA is weak or non-existent. It’s not part of the user’s flow.</li><li>Action: This is a core part of <a href="https://cleancommit.io/blog/ecommerce-landing-page-optimization/?ref=blog.cleancommit.io">ecommerce landing page optimization</a>. Don’t just put a link in the footer. Add a visually appealing “Join Our List” section in the middle of the post (offering a relevant lead magnet or discount) and again at the end.</li></ul><h3>Use A/B Testing to Validate Your Actions</h3><p>Your new analyses are strong hypotheses, but they are still <em>just</em> hypotheses. You <a href="https://cleancommit.io/blog/how-to-ab-test-ecommerce-store/?ref=blog.cleancommit.io#when-to-use-experiments">must test them to get definitive, data-backed proof</a>.</p><p><em>How failed A/B test can deliver value?</em></p><p>Problem: Your “Wishlist” assessment shows a low add_to_wishlist micro conversion rate.</p><ul><li>Hypothesis: The “Add to Wishlist” feature is a small, text-only link that people don’t see.</li><li>Action: Don’t just change it! Run an experiment. This is where you learn <a href="https://cleancommit.io/blog/how-to-ab-test-ecommerce-store/?ref=blog.cleancommit.io">how to A/B test your ecommerce store</a>.</li><li>Control (A): The current text link.</li><li>Variant (B): A new, prominent “❤️ Save for Later” button next to your “Add to Cart” button.</li><li>Result: Let the data prove which version <em>actually</em> drives more micro conversions.</li></ul><h3>Conclusion: Stop Chasing the Sale. Start Fixing the Steps.</h3><p>The <a href="https://cleancommit.io/resources/ultimate-analysis-of-3897-shopify-stores/?ref=blog.cleancommit.io">best-run Shopify stores don’t just focus on the finish line</a>. The difference between a struggling Shopify store and a high-growth one isn’t just about “getting more traffic.” It’s about a fundamental shift in perspective.</p><p>It’s the shift from obsessing over the final macro conversion to meticulously optimizing every micro conversion that leads to it.</p><p>You now have a powerful framework to do this. You’re no longer just “looking at data” — you are:</p><ol><li>Auditing your funnel by analyzing Process Milestones to find <em>exactly</em> where functional friction is costing you sales.</li><li>Assessing your features by tracking Secondary Actions to understand if your site is truly <em>helping</em> users or just getting in their way.</li></ol><p>You don’t have to guess anymore. You don’t have to wonder why your “Add to Cart” rate is low, why no one uses your site search, or why your new blog post isn’t generating leads. You have the tools to ask the right questions — “What is functionally required?” — and find the data-backed answers.</p><p>Your journey to a higher-converting store starts now.</p><p>Log into your analytics. Don’t try to fix everything at once. Pick just one process milestone (like Add to Cart) and one secondary action (like Site Search) to analyze this week.</p><p>Find the friction. Fix the leak. Measure the change.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97dde780d5b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shopify Hack: Merge Variants on a Single Product Page]]></title>
            <link>https://mrkaluzny.medium.com/shopify-hack-merge-variants-on-a-single-product-page-653fe7678767?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/653fe7678767</guid>
            <category><![CDATA[shopify-store]]></category>
            <category><![CDATA[shopify-development]]></category>
            <category><![CDATA[liquid]]></category>
            <category><![CDATA[shopify]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 10:49:16 GMT</pubDate>
            <atom:updated>2024-09-03T10:49:16.916Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fZxtKm3Snvh57m_q" /><figcaption>Photo by <a href="https://unsplash.com/@priscilladupreez?utm_source=medium&amp;utm_medium=referral">Priscilla Du Preez 🇨🇦</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Shopify imposes certain limits on product variants to maintain a streamlined experience for users and manage performance effectively. Specifically, Shopify allows up to 100 variants per product and supports up to 3 options (like size, color, or material) per product. This can become problematic for businesses that offer extensive product lines with numerous variations.</p><p>When a product reaches these limits, you face several challenges:</p><ul><li><strong>Product Management</strong>: Handling more than 100 variants can become cumbersome. Merchants must either create additional listings or simplify their product offerings, both of which can complicate inventory management and negatively impact the user experience.</li><li><strong>Customer Experience</strong>: Shoppers may find it confusing to navigate between multiple product listings that essentially offer the same item but with different variations. This fragmentation can lead to a poor user experience and potentially lost sales.</li><li><strong>Store Organization</strong>: Splitting variants across multiple product pages can clutter the store, making it harder for customers to find what they’re looking for and for store owners to maintain a clean, organized inventory.</li></ul><p>If you’re facing these issues, our experienced Shopify Developers Services can help you navigate these limitations and create custom solutions tailored to your store’s needs.</p><h3>Combining Variants into a Single Product Page</h3><p>To address these limitations, you can leverage Shopify’s metafields and Liquid code to aggregate variants from multiple products into a single product page. This approach allows you to bypass the variant limit by linking additional products (referred to as “child products”) to a primary product.</p><p>Our <a href="https://cleancommit.io/shopify-app-development/">Shopify App Development team can also build custom apps that extend Shopify’s functionality</a>, including the ability to manage complex product catalogs and streamline variant management.</p><h4>Create a Custom Metafield for Child Products</h4><ol><li>Define the Metafield:</li><li>In your Shopify admin, navigate to Settings &gt; Metafields &gt; Products.</li><li>Create a new metafield definition, naming it something like connection.child_products.</li><li>Configure it to accept multiple product references.</li><li>Assign Child Products:</li><li>For each main product that exceeds the variant limit, assign relevant child products using this metafield. These child products will be linked but not directly listed as separate items.</li></ol><p><em>Need assistance setting up custom metafields? Explore our </em><a href="https://cleancommit.io/shopify-development/"><em>Shopify services to get expert help</em></a><em>.</em></p><h3>Update Product Page Code to Include Child Product Variants</h3><p>When dealing with Shopify’s variant limits, ensuring that all your product variants appear on a single page can feel like trying to fit a square peg into a round hole. Fortunately, with a bit of Liquid code, you can combine all the variants from your main product and its related child products into one seamless display.</p><p>To start, you’ll need to adjust the Liquid code in your product template to pull in variants from both the main product and any connected child products. Here’s how you can do it:</p><pre>{%- liquid<br>  assign child_products = product.metafields.connection.child_products.value<br>  assign variants = product.variants<br>  assign media = product.media<br>  <br>  // Add child_products data to variants and media<br>  for sub_product in child_products<br>    assign variants = variants | concat: sub_product.variants<br>    assign media = media | concat: sub_product.media<br>  endfor<br>-%}</pre><p>For more context, let me explain:</p><ul><li><strong>child_products</strong>: Retrieves the products linked to the main product through the custom metafield “child_products.”</li><li><strong>variants and media</strong>: Initially assigned the main product’s variants and media, then expanded to include those from the child products.</li></ul><h3>Update rendering logic in corresponding templates</h3><p>To make sure all these combined variants appear on your product page, you’ll need to adjust how variants and media files are rendered. Essentially, you’ll replace product.variants and <a href="https://product.media/">product.media</a> with your newly aggregated variants and media collections. Here’s what that looks like:</p><pre>// main-product.liquid<br>{% render &#39;product-variant-select&#39;, product: product, block: block, product_form_id: product_form_id %}<br>// changes to<br>{% render &#39;product-variant-select&#39;, variants: variants product: product, block: block, product_form_id: product_form_id %}<br><br>// snippets/product-variant-select.liquid<br>{%- for variant in product.variants -%}<br>// changes to <br>{%- for variant in variants -%}</pre><p>The sections/main-product.liquid file is where you call the variant selection snippet, now passing in the aggregated variants collection instead of just product.variants.</p><p>In the snippets/product-variant-select.liquid file, the loop is adjusted to iterate over variants instead of product.variants, ensuring all the variants from both the main product and its child products are displayed.</p><p>Once these changes are in place, your product pages will seamlessly display all variants from the connected products. This means your customers can view and select from the full range of options without navigating between multiple listings.</p><h3>Wrapping It Up</h3><p>By creating custom metafields and tweaking your product page code, you can effectively bypass Shopify’s variant limits. This approach not only simplifies how you manage your inventory but also provides a smoother, more comprehensive shopping experience for your customers. No more juggling multiple product pages — everything they need is right there in one place!</p><p>Ready to take your Shopify store to the next level? Whether you need <a href="https://cleancommit.io/shopify-development/">Shopify Development</a> or <a href="https://cleancommit.io/shopify-app-development/">specialized Shopify Apps Development</a>, our expert team is here to help you achieve your e-commerce goals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=653fe7678767" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Seamless Shopify Remix Deployment: A Guide to Laravel Forge & TursoDB]]></title>
            <link>https://mrkaluzny.medium.com/seamless-shopify-remix-deployment-a-guide-to-laravel-forge-tursodb-635bafef731e?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/635bafef731e</guid>
            <category><![CDATA[turso]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[remix]]></category>
            <category><![CDATA[laravel-forge]]></category>
            <category><![CDATA[sqlite]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 10:01:29 GMT</pubDate>
            <atom:updated>2024-09-03T10:01:29.010Z</atom:updated>
            <content:encoded><![CDATA[<p>With Shopify advancing its checkout extensibility features, the need for <a href="https://cleancommit.io/shopify-app-development/">bespoke apps tailored for Shopify Plus merchants</a> is increasing. To streamline our deployment process and facilitate the development of Remix-based Shopify applications, we’ve chosen a minimalist set of tools.</p><p>Since the Remix starter app relies on SQLite, we opted for <a href="https://turso.tech/">TursoDB</a> to manage our SQLite databases in production. For server management, we’ve went with our favourite — Laravel Forge to simplify and automate server setup and maintenance.</p><h3><strong>Set Up Your Database with TursoDB</strong></h3><p>Start by logging into your <a href="https://docs.turso.tech/quickstart">TursoDB account</a>. From the dashboard, create a new database instance. Follow the prompts to set up your database, including selecting the appropriate region.</p><p>Once the database is created, you’ll need to generate a Read &amp; Write authorisation token that will work with your <a href="https://cleancommit.io/shopify-app-development/">Shopify application</a>.</p><h4><strong>Connecting Remix Shopify App with TursoDB</strong></h4><p>In our case we’re using <a href="https://www.prisma.io/docs/orm/overview/databases/turso">Prisma with Turso</a>. To connect the initial remix template with Shopify App you’ll need to adjust the initial setup a bit.</p><p>First install libSQL database client and Prisma ORM driver adapter for libSQL packages:</p><pre>npm install @libsql/client @prisma/adapter-libsql</pre><p>Update db.server.js file to use the new adapter</p><pre>import { PrismaClient } from &quot;@prisma/client&quot;;<br>import { PrismaLibSQL } from &quot;@prisma/adapter-libsql&quot;;<br>import { createClient } from &quot;@libsql/client&quot;;<br><br>const prismaClientSingleton = () =&gt; {<br>  const libsql = createClient({<br>    url: process.env.TURSO_DATABASE_URL,<br>    authToken: process.env.TURSO_AUTH_TOKEN,<br>  });<br><br>  const adapter = new PrismaLibSQL(libsql);<br><br>  return new PrismaClient({ adapter });<br>};<br><br>const prisma = global.prisma || prismaClientSingleton();<br><br>if (process.env.NODE_ENV !== &quot;production&quot;) {<br>  if (!global.prisma) {<br>    global.prisma = prismaClientSingleton();<br>  }<br>}<br><br>export default prisma;</pre><p>Update prisma configuration file prisma.schema</p><pre>generator client {<br>  provider = &quot;prisma-client-js&quot;<br>  previewFeatures = [&quot;driverAdapters&quot;]<br>}<br><br>datasource db {<br>  provider = &quot;sqlite&quot;<br>  url      = env(&quot;DATABASE_URL&quot;)<br>}</pre><p>Update your .env file by passing Turso Database Url and AUTH token</p><pre>DATABASE_URL=file:./dev.db<br>TURSO_DATABASE_URL=libsql://[database].turso.io<br>TURSO_AUTH_TOKEN=</pre><h4><strong>Migrating database to Turso</strong></h4><p>It’s time to move all off the existing migrations to your Turso DB, in order to do that you’ll need to create an .sql script to run the migrations and import it into the database.</p><pre>npx prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script &gt; init.sql<br><br>turso db shell [database] &lt; ./prisma/migrations/</pre><p>To apply any subsequent migrations you’ll have to generate them and apply them manually</p><pre>npm run prisma migrate dev --name migration<br><br>turso db shell turso-prisma-db &lt; ./prisma/migrations/20240922132717_migration/migration.sql</pre><h3><strong>Preparing a server with Laravel Forge</strong></h3><p>Laravel Forge is a powerful server management and deployment tool designed primarily for Laravel applications, but its versatility extends to a wide range of applications, including those built with Node.js. Forge simplifies the process of provisioning and managing servers, automating tasks such as server configuration, deployment, and monitoring.</p><p>For your <a href="https://cleancommit.io/shopify-app-development/">Shopify Remix application</a>, which doesn’t need a database, we’ll kick things off with a Web Server preset. Don’t worry about PHP cluttering up your setup; we’ll trim it away and fine-tune the server to perfectly match your Remix needs.</p><h4><strong>Creating a server</strong></h4><p>To create a server with Laravel Forge, log into your Forge account and hit “Create Server.” Choose your provider (we use <a href="https://m.do.co/c/8fa4146d6483">Digital Ocean</a>) nad preset — in our case <em>Web Server</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rSLGfJkohTxFOGCvDz2ndw.png" /></figure><p>After the server provisions, you need to sync the application with your repository by passing the account-name/project-name and selecting a branch. Once the repository is successfully connected and installed there are just a couple steps left.</p><h4><strong>Update Node version if necessary</strong></h4><p>Sometimes, Forge might kick off with an older version of Node than you need. No worries — just SSH into your server or run the script below, or create a Forge Recipe, to update to Node v20. If you prefer, you can also <a href="https://github.com/nvm-sh/nvm">install NVM (Node Version Manager)</a> on the server to keep your Node versions in check with your application’s needs.</p><pre>curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg<br>NODE_MAJOR=20<br>echo &quot;deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main&quot; | sudo tee /etc/apt/sources.list.d/nodesource.list<br><br>sudo apt-get update --allow-releaseinfo-change &amp;&amp; sudo apt-get install nodejs -y</pre><h4><strong>Create a daemon to run Shopify App</strong></h4><p>Time to get your Shopify app running smoothly! First, let’s set up a daemon to keep things chugging along. We’ll use the command npm run start, and it should be run in the folder where your app is living — /home/forge/domain-name.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLEd29pFKE6B4cc1Na1-Yw.png" /></figure><p>After your daemon is up and running, grab the process ID so you can easily restart it during deployments. Think of it like giving your app a personal assistant that keeps it on its toes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uKM8yzYYhYjke06Gkklug.png" /></figure><h4><strong>Configure deployment script</strong></h4><p>Let’s get your Shopify App deployments running like a well-oiled machine! The key is to configure the deployment script so that your app gets built and the daemon gets a fresh start.</p><p>Here’s a basic script for deploying your Shopify app on Laravel Forge:</p><pre>git pull origin $FORGE_SITE_BRANCH<br><br>npm ci<br><br>npm run build<br><br>sudo -S supervisorctl restart daemon-946354:*</pre><p>Just swap <strong>946354</strong> with the ID of your daemon from earlier.</p><p>If you’re using NVM, don’t forget to add nvm use right after git pull to make sure you’re on the right Node version defined in .nvmrc file.</p><h4><strong>Give Nginx a Remix for Your Shopify App</strong></h4><p>Now, for the grand finale — tweaking the Nginx configuration! Laravel Forge sets you up with a basic config that’s all about PHP, but we’re here to remix it for your Shopify app.</p><pre>## Default configuration<br> location ~ \.php$ {<br>   fastcgi_split_path_info ^(.+\.php)(/.+)$;<br>   fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;<br>   fastcgi_index index.php;<br>   include fastcgi_params;<br> }<br><br>## Node/Remix configuration <br> location / {<br>        proxy_pass http://127.0.0.1:3000;<br>        proxy_http_version 1.1;<br>        proxy_set_header Upgrade $http_upgrade;<br>        proxy_set_header Connection ‘upgrade’;<br>        proxy_set_header Host $host;<br>        proxy_cache_bypass $http_upgrade;<br>    }</pre><p>The new configuration is designed to handle requests for a Node.js app, such as a Shopify Remix app. Instead of processing PHP, it proxies all incoming requests to a Node.js server running on <a href="http://127.0.0.1:3000.">http://127.0.0.1:3000.</a></p><ul><li>location /: Matches all incoming requests, regardless of the path, and sends them to the Node.js server.</li><li>proxy_pass <a href="http://127.0.0.1:3000;:">http://127.0.0.1:3000;:</a> Directs all traffic to the Node.js app running locally on port 3000.</li><li>proxy_http_version 1.1;: Ensures the proxy uses HTTP/1.1, which supports features like keep-alive connections, necessary for modern web applications.</li><li>proxy_set_header Upgrade $http_upgrade; and proxy_set_header Connection ‘upgrade’;: These headers are essential for handling WebSocket connections, allowing your Node.js app to manage real-time communications.</li><li>proxy_set_header Host $host;: Preserves the original Host header in the request, making sure the app knows the correct hostname it’s serving.</li><li>proxy_cache_bypass $http_upgrade;: Prevents caching for upgraded connections (like WebSockets), ensuring a direct, uninterrupted connection.</li></ul><p>In short, this change redirects all incoming traffic from Nginx to your Node.js app, ditching the PHP processing in favor of serving your Remix-based Shopify app directly.</p><h3><strong>Deploy the App</strong></h3><p>Now, it’s time for the moment of truth — deploy your Shopify app! With everything set up, just push your code, and if you’ve enabled Quick Deploys, Forge will automatically redeploy your app with every new commit to the branch. Head over to your domain and check that everything is up and running smoothly!</p><h3><strong>Server Cleanup: Disable PHP-FPM</strong></h3><p>Since we’re not using PHP, we can safely disable php-fpm process to save resources for serving Remix application. I suggest to run this as a <a href="https://forge.laravel.com/docs/servers/recipes.html">Forge Recipe</a>, but you can also do it directly on the server.</p><pre>sudo systemctl stop php8.3-fpm<br>sudo systemctl disable php8.3-fpm</pre><h3><strong>Wrapping Up</strong></h3><p>Congratulations! Your Shopify Remix app is now live, running on a lean, Node-powered server with everything fine-tuned for optimal performance. From setting up your database with TursoDB to deploying via Laravel Forge, you’ve got a streamlined process that makes managing your app a breeze.</p><p>Want to dive deeper into Shopify’s latest changes? Check out this <a href="https://cleancommit.io/blog/adapting-to-shopifys-new-checkout-extensibility/">article on adapting to Shopify’s new checkout extensibility for more insights</a>. Plus, explore other guides on server management, database optimization, or browse more articles to supercharge your Shopify experience with custom apps and seamless integrations. Happy coding! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=635bafef731e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AlpineJS: The Modern Alternative to jQuery You Need to Try]]></title>
            <link>https://mrkaluzny.medium.com/alpinejs-the-modern-alternative-to-jquery-you-need-to-try-f5ca240d0923?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5ca240d0923</guid>
            <category><![CDATA[jquery]]></category>
            <category><![CDATA[shopify-development]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[alpine]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 09:39:58 GMT</pubDate>
            <atom:updated>2024-09-03T09:39:58.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WOiRCoMk_kJJNYzf" /><figcaption>Photo by <a href="https://unsplash.com/@sigmund?utm_source=medium&amp;utm_medium=referral">rivage</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’ve been around the web development block as long as I have, you’ve seen the rise and fall of countless frameworks. I’ve danced with jQuery, navigated the waters of Vue, ridden the React rollercoaster, and even tried my luck with Angular (we don’t talk about that). But in this ever-evolving landscape, there’s an under-the-radar tool that has been gaining serious traction, especially in the Laravel community with the <a href="https://tallstack.dev/">TALL stack</a>: AlpineJS. And let me tell you, it’s a game-changer, especially for those of us working with platforms like <a href="https://cleancommit.io/shopify-development/">Shopify</a> and <a href="https://cleancommit.io/woocommerce-development/">WordPress</a></p><h4><strong>A Blast from the Past: The jQuery Era</strong></h4><p>Remember the days when jQuery was the go-to for all things JavaScript? It was magical! You could manipulate the DOM, handle events, and create animations with a few lines of code. jQuery made JavaScript approachable and fun, turning complex tasks into simple, elegant code snippets. But as web development evolved, so did the need for more robust frameworks. Enter Vue, React, and Angular — powerhouses that took the world by storm, but often at the cost of simplicity.</p><h4><strong>Why AlpineJS is the Modern jQuery</strong></h4><p>Fast forward to today, and web development has come full circle. Server-side rendering is back in vogue, and there’s a growing demand for lightweight, easy-to-implement solutions. This is where AlpineJS shines.</p><p>AlpineJS is a minimal, lightweight JavaScript framework that gives you the power of React and Vue at a fraction of the complexity. Here’s why:</p><ul><li><strong>Tiny Footprint</strong>: Here’s the kicker: AlpineJS is tiny. At around 10KB minified (and gzipped), Alpine is dramatically smaller than jQuery, which comes in at around 90KB minified. That’s nearly a 10x difference! This small size means faster load times and better performance, particularly on mobile devices or in environments where every kilobyte counts.</li><li><strong>Simplicity</strong>: Just like jQuery, AlpineJS is easy to learn and quick to implement. You don’t need to set up a build process or deal with complex configurations. Just drop a script tag on your page, and you’re good to go.</li><li><strong>Reactive and Declarative</strong>: Alpine brings the reactivity of modern frameworks to your HTML. No need to learn a new language or syntax — just add a few x- attributes to your HTML, and you’ve got dynamic, reactive components.</li><li><strong>No Build Step Required</strong>: Unlike React or Vue, Alpine doesn’t require a complex build process. You can include it directly in your HTML and start building interactive components right away.</li><li><strong>Works Seamlessly with Existing Tech</strong>: Whether you’re working with a modern stack or maintaining a legacy site, AlpineJS fits right in. It’s especially well-suited for platforms like Shopify and WordPress, where you might not have the luxury of a full JavaScript framework.</li></ul><p><strong>I prefer AlpineJS because it combines powerful features with a much smaller footprint than jQuery, making it a leaner and more efficient choice for modern web development.</strong></p><p><strong>AlpineJs vs jQuery — Comparison</strong></p><p>Let’s compare how AlpineJS and jQuery handle a common use case: toggling the visibility of a menu.</p><p>jQuery Example</p><pre>$(&#39;#toggleButton&#39;).click(function() {<br>  $(&#39;#menu&#39;).toggle();\<br>});</pre><p>Alpine Example</p><pre>&lt;div x-data=&quot;{ open: false }&quot;&gt;<br> &lt;button @click=&quot;open = !open&quot; id=&quot;toggleButton&quot;&gt;Toggle Menu&lt;/button&gt;<br> &lt;div x-show=&quot;open&quot; id=&quot;menu&quot; x-cloak&gt;This is the menu content&lt;/div&gt;<br>&lt;/div&gt;</pre><p>In this simple example, AlpineJS offers a more declarative approach, embedding the logic directly within the HTML. There’s no need to wait for the DOM to be ready or manually bind events — it’s all seamlessly integrated.</p><h4><strong>A More Complex UI: Slide-Out Cart</strong></h4><p>Here’s a more complex example: a slide-out cart UI.</p><p>AlpineJS Example</p><pre>&lt;div x-data=&quot;{visible: false}&quot; x-cloak&gt;<br>  &lt;button @click=&quot;visible = !visible&quot;&gt;Toggle Cart&lt;/button&gt;<br>  &lt;div<br>    x-show=&quot;visible&quot;<br>    class=&quot;fixed left-0 top-0 z-50 h-full w-full bg-black bg-opacity-50&quot;<br>    x-transition:enter=&quot;transition ease-out duration-300&quot;<br>    x-transition:enter-start=&quot;opacity-0&quot;<br>    x-transition:enter-end=&quot;opacity-100&quot;<br>    x-transition:leave=&quot;transition ease-out duration-300&quot;<br>    x-transition:leave-start=&quot;opacity-100 &quot;<br>    x-transition:leave-end=&quot;opacity-0&quot;&gt;&lt;/div&gt;<br>  &lt;div<br>    x-show=&quot;visible&quot;<br>    @click.outside=&quot;visible = false&quot;<br>    @keyup.escape.window=&quot;visible = false&quot;<br>    class=&quot;pointer-events-auto fixed right-0 top-0 z-50 h-dvh w-full max-w-lg&quot;<br>    x-transition:enter=&quot;transition ease-out duration-300&quot;<br>    x-transition:enter-start=&quot;translate-x-full&quot;<br>    x-transition:enter-end=&quot;translate-x-0&quot;<br>    x-transition:leave=&quot;transition ease-out duration-300&quot;<br>    x-transition:leave-start=&quot;translate-x-0&quot;<br>    x-transition:leave-end=&quot;translate-x-full&quot;&gt;<br>    Hello Cart<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>In jQuery this would look like that</p><pre>&lt;div id=&quot;cartContainer&quot; class=&quot;relative&quot;&gt;<br>  &lt;button id=&quot;toggleButton&quot;&gt;Toggle Cart&lt;/button&gt;<br><br>  &lt;!-- Background Overlay --&gt;<br>  &lt;div<br>    id=&quot;overlay&quot;<br>    class=&quot;pointer-events-none fixed left-0 top-0 z-50 h-full w-full bg-black bg-opacity-50 opacity-0 transition-opacity duration-300&quot;&gt;&lt;/div&gt;<br><br>  &lt;!-- Cart Panel --&gt;<br>  &lt;div<br>    id=&quot;cartPanel&quot;<br>    class=&quot;pointer-events-auto fixed right-0 top-0 z-50 h-dvh w-full max-w-lg translate-x-full transform bg-white transition-transform duration-300&quot;&gt;<br>    Hello Cart<br>  &lt;/div&gt;<br>&lt;/div&gt;<br><br>&lt;script&gt;<br>  $(document).ready(function () {<br>    let visible = false;<br><br>    $(&#39;#toggleButton&#39;).click(function () {<br>      visible = !visible;<br>      toggleCart();<br>    });<br><br>    $(&#39;#overlay&#39;).click(function () {<br>      visible = false;<br>      toggleCart();<br>    });<br><br>    $(document).keyup(function (e) {<br>      if (e.key === &#39;Escape&#39;) {<br>        visible = false;<br>        toggleCart();<br>      }<br>    });<br><br>    function toggleCart() {<br>      if (visible) {<br>        $(&#39;#overlay&#39;)<br>          .removeClass(&#39;opacity-0 pointer-events-none&#39;)<br>          .addClass(&#39;opacity-100 pointer-events-auto&#39;);<br>        $(&#39;#cartPanel&#39;)<br>          .removeClass(&#39;translate-x-full&#39;)<br>          .addClass(&#39;translate-x-0&#39;);<br>      } else {<br>        $(&#39;#overlay&#39;)<br>          .removeClass(&#39;opacity-100 pointer-events-auto&#39;)<br>          .addClass(&#39;opacity-0 pointer-events-none&#39;);<br>        $(&#39;#cartPanel&#39;)<br>          .removeClass(&#39;translate-x-0&#39;)<br>          .addClass(&#39;translate-x-full&#39;);<br>      }<br>    }<br>  });<br>&lt;/script&gt;</pre><p><strong>Simplicity and Clean Code</strong> AlpineJS allows you to manage state (visible) and handle events directly within the HTML using attributes like x-show, @click, and @keyup.escape.window. This approach reduces the need for separate JavaScript code, resulting in cleaner and more maintainable code.</p><p><strong>Transitions are built in</strong> With AlpineJS, transitions are handled declaratively using x-transition. You don’t have to manually toggle classes or write complex JavaScript logic to achieve the same effects. This makes your code more intuitive and easier to understand.</p><p><strong>Event Handling</strong> AlpineJS simplifies event handling by allowing you to bind events like click and keyup.escape.window directly within the HTML, which is more straightforward than writing separate jQuery event listeners.</p><p><strong>Automatic DOM Updates</strong> AlpineJS automatically updates the DOM when the state changes. In the jQuery version, you need to write functions to manually update the DOM, which adds more code and complexity.</p><p><strong>Reduced Boilerplate</strong> With AlpineJS, there’s no need for additional setup or $(document).ready functions. You simply declare what you need in your HTML, making the code more concise.</p><p><strong>Great choice for Laravel Blade and Shopify’s Liquid</strong></p><p>Now, let’s talk about how AlpineJS plays nicely with templating engines like <a href="https://shopify.github.io/liquid/">Liquid(used in Shopify)</a> and <a href="https://laravel.com/docs/11.x/blade">Laravel Blade</a>. These engines are all about rendering dynamic content on the server, and AlpineJS complements this by adding interactivity on the client side.</p><p>In a <a href="https://cleancommit.io/shopify-development/">Shopify project</a>, for example, you might use Liquid to render a product list server-side, then sprinkle some Alpine magic to add interactive elements like filters, modals, or dynamic content toggles. Because Alpine works directly in your HTML, there’s no need to overhaul your existing Liquid templates — just enhance them.</p><p>Similarly, in a Laravel project using Blade (like a <a href="https://cleancommit.io/woocommerce-development/">modern WooCommerce Store</a>), Alpine allows you to add reactive components directly within your Blade templates. Need a dropdown menu or a dynamic form? Alpine has you covered with a few simple attributes, keeping your Blade templates clean and maintainable.</p><h3><strong>The Future is Alpine</strong></h3><p>In a world where web development is increasingly complex, AlpineJS offers a breath of fresh air. It’s lightweight, simple, and powerful enough to handle most of the interactivity you’ll need in modern web projects. Whether you’re working with an older tech stack or just want a simpler alternative to heavy frameworks, AlpineJS is a fantastic choice. It’s like jQuery for the modern era — _familiar yet fresh, powerful yet lightweight_.</p><p>So, next time you’re about to reach for jQuery or set up a complex React project for a simple site, give AlpineJS (or HTMX) a try. You might just find they’re the tools you’ve been looking for all along.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5ca240d0923" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gatsby Starter Henlo — The Best Starter for Netlify CMS]]></title>
            <link>https://mrkaluzny.medium.com/gatsby-starter-henlo-the-best-starter-for-netlify-cms-691a90c828c5?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/691a90c828c5</guid>
            <category><![CDATA[static-site]]></category>
            <category><![CDATA[netlifycms]]></category>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[gatsby]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Wed, 26 Oct 2022 14:17:14 GMT</pubDate>
            <atom:updated>2022-10-26T14:17:14.055Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G7y6C6aMd1SCzGGcPRZuEg.png" /><figcaption>Gatsby Starter Henlo Landing Page</figcaption></figure><h3>Gatsby Starter Henlo — The Best Starter for Netlify CMS</h3><p>Gatsby is arguably the best choice for building simple, lightweight, highly optimized websites. For website developers, it provides answers to a lot of the weird problems we’ve had to accept in WordPress. However, the area it can’t compete with WordPress is out-of-the-box content management.</p><p>After playing around with most of the popular CMS options on the market, we found that Netlify CMS is the best solution to pair with Gatsby for smaller sites that only want to show an online presence and publish an article here or there.</p><p>Even though Netlify CMS is the right choice, users are limited in how they can maintain their website beyond simple content changes. Want to move a call to action further up the page? Bad luck. You’ll need to speak to your developer.</p><h3>Our solution</h3><p>Our solution to this problem is an official <a href="https://henlo.cleancommit.io/">Gatsby + Netlify CMS</a> starter that utilizes custom plugins and beta features to provide a WordPress-like experience.</p><p>In addition to unlocking flexible content management, the starter focuses on providing a way for developers and small businesses to build blazing-fast, simple, cheap-to-maintain websites.</p><h3>Introducing Gatsby Starter Henlo</h3><p>As an agency that builds websites for paying clients, we’re always on a mission to provide the best possible flexibility and performance. There are plenty of ways to deliver a performant site which are all slightly different depending on the stack we’re using. However, for flexibility, we use the same approach regardless of the CMS or technology.</p><p>This CMS setup comes straight from Advanced Custom Fields (ACF) Flexible Content field in WordPress. Each section we create is a reusable component that can be added to any page through the site. This allows content editors to grow pages without any need for changing content structures and eases further development of the page.</p><p>Netlify CMS is my personal favourite flat-file CMS out there, that’s why we decided to create a special starter that allows everyone to create absurdly fast, flexible websites without any issues.</p><h3>Page Builder &amp; Blocks — How to make Netlify CMS more flexible?</h3><p>Since we like the way WordPress manages content, we started with 3 default post types — Pages, Posts and Authors. These are the basis of almost all modern websites.</p><h3>Flexible pages</h3><p>In our approach, there’s no need for additional page templates because every page is controlled by a Page Builder. Using Blocks it’s easy to generate blog pages, partner pages or any other page you want.</p><p>There’s only one problem — slugs. By default, slugs are generated based on the file name of the markdown file created within the Netlify CMS collection. This causes quite an issue, that’s why we had to create a widget — <a href="https://github.com/clean-commit/netlify-cms-widget-permalink#readme">Netlify CMS Permalink Widget</a> — which duplicates WordPress slugs handling. Instead of using filenames, we save slug directly in the markdown file, this allows for creating robust sitemaps with ease.</p><h3>Additional Post Types</h3><p>Posts &amp; Authors are set up to create the blog functionality of the site. This can be extended further by adding additional post types (or collections using Netlify’s CMS nomenclature).</p><p>Normally we want to use post types to re-use the content across different Blocks, but this can cause issues due to the way Netlify CMS works. We can refer to different documents by one of the populated fields, when the referred field changes the connection between Block and that document is broken (yes it’s a massive pain in the ass).</p><p>The solution was brilliantly simple — unique IDs. We’ve created an additional widget for Netlify CMS to handle that, meet <a href="https://github.com/clean-commit/netlify-cms-widget-id">Netlify CMS ID Widget</a>. This widget generates unique IDs for each document, which allows us to create connected Blocks for displaying selected posts/FAQs/case studies and any post type you might want.</p><p>While creating new post types you might want to use a slug widget as well, it can automatically add a base path, which allows content editors to change slugs quickly and efficiently while reusing Page Builder, helping you save development time.</p><h3>Previews — out of the box!</h3><p>To make sure Netlify CMS is the best it can be for users, previews are reusing the same Block components as the actual page (🤯). This allows for a quick preview of the content without a build phase. The only case you have to handle is a dynamic reference to other post types.</p><h3>Forms builder — baked in 🔥</h3><p>Netlify offers an amazing solution for handling forms, but creating forms with Gatsby kind of sucks. Well, no more!</p><p>Every website requires forms, so it was a no-brainer to include a system to generate and reuse them easily (think Contact Form 7 for Gatsby). Content editors can create native forms without the developer’s help by utilizing instant previews, and reusing them across different pages.</p><h3>Easily manageable settings</h3><p>The last part to make Netlify CMS more approachable was introducing JSON-based settings. With this approach, fallback values such as SEO descriptions, titles and more can be changed from the CMS level directly and used even during build processes.</p><p>We’ve added this to enable you to create themes that can be reused across different pages when needed.</p><h3>Great DX is crucial</h3><p>Improvements to Netlify CMS were made to ensure the best developer experience. We switched to manual initialization dumping Yaml in favour of JavaScript config. Yes, you can use functions to generate collections (and yes it is awesome!). Working with lots of Blocks and different fields has never been easier!</p><p>Additionally, Netlify CMS is ready to be run locally. Hence, it’s possible to change the configuration and review changes quickly, as well as create new content using Netlify CMS without creating markdown files.</p><h3>All great features of Gatsby Starter Henlo</h3><ul><li>💪 Battle-tested starting point for small &amp; large web projects</li><li>📄 Form Builder that enables Admins to create multiple forms with ease &amp; Netlify Forms integration</li><li>🌗 Darkmode support</li><li>🗺 Sitemaps using gatsby-plugin-sitemap</li><li>🔥 Perfect score on Lighthouse for SEO, Accessibility and Performance</li><li>💇‍♀️ TailwindCSS support with PostCSS processing &amp; PurgeCSS</li><li>🔌 Support for Gatsby API functions</li><li>🎇 Crazy fast images with gatsby-plugin-image</li><li>🕵️‍♂️ Complete SEO configuration with GraphQL fragment and reusable components</li><li>Netlify deploy configuration</li><li>Example pages, collections, CMS configuration with Netlify CMS &amp; hooks</li><li>Readme template for custom projects</li><li>Easy Netlify CMS configuration using Manual Initialization ..and more</li></ul><p>If you’d like to test it out, check out our <a href="https://www.google.com/url?q=https://github.com/clean-commit/gatsby-starter-henlo&amp;sa=D&amp;source=editors&amp;ust=1666702711453888&amp;usg=AOvVaw33avYa11E2eMLUK-BsY2Bf">Gatsby Starter Henlo GitHub repo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=691a90c828c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we use Tailwind CSS as our primary framework?]]></title>
            <link>https://levelup.gitconnected.com/why-we-use-tailwind-css-as-our-primary-framework-ed8994dec949?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed8994dec949</guid>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Tue, 12 Oct 2021 11:49:52 GMT</pubDate>
            <atom:updated>2024-09-03T09:44:50.705Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xvo7JMwro3-g5yMp.jpg" /></figure><p>Selecting the right CSS framework is key to scaling the team’s capabilities and experience over time. When working with many technologies internally, it’s crucial to streamline as many processes as possible to avoid inefficiency. Time is money!</p><p>Over the past few years at Clean Commit, we’ve built a vast spread of applications and websites. Since 2020 we have been investing in growing our JAM Stack capabilities, focusing on <a href="https://cleancommit.io/headless-ecommerce/">top-performing e-commerce projects using Shopify, BigCommerce</a> and other headless-enabled systems.</p><p>At the same time, we’re still actively <a href="https://cleancommit.io/woocommerce-development/">developing new projects based on WordPress and WooCommerce</a> when it makes sense. Not to mention that our team is actively developing custom applications with different stacks.</p><p>If you spot any of our products in the wild, you will see the use of different technologies and frameworks like React, Vue and templating languages like Laravel Blade on the front end. These technologies are significantly different, so we’ve had to find a way to standardise their implementations as much as possible.</p><h3>Problem — lack of standardisation</h3><p>We work with many different technologies. Using multiple front-end frameworks and backend technologies complicates work when our devs switch from project to project. Additionally, some of our projects used different styling approaches. Jumping between styling approaches made it almost impossible to reuse visual components between projects.</p><p>With Tailwind, we’ve been able to standardise CSS across all of our projects. Sticking to a consistent approach makes it easier to code at a constant pace, grow our front-end team’s know-how and achieve visual bug-free outcomes quickly and reliably. It’s also significantly easier to reuse components across different projects, even when using different front-end frameworks.</p><h3>The way we worked before Tailwind</h3><p>Back in 2015, our team was in love with Bootstrap. Bundled UI components made it easy to create handsome apps and sites, so we did just that. Efficient! Right..? Well, no, not really.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*J4bcBG-Kavq8LN8zDtBO5A.jpeg" /></figure><p>As we grew and our designs became more complicated, we started using custom styles added on top of Bootstrap. In the long run, this approach added unnecessary bloat to our projects and complicated the codebase.</p><p>The latter was solved by introducing BEM, and we tried to resolve the former by adding utility classes. After all, why should we repeat our code when we can simply reuse classes. Brilliant! Well, not really. This approach made us ask the question — do we even need Bootstrap? We modified it heavily already, cut out components we don’t need, added a bunch of utility classes on top and then added a lot of custom code on top for each project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*IbbqeBHMgmk17QYqxWAI6Q.jpeg" /><figcaption>My brilliant plan to optimize Bootstrap</figcaption></figure><p>Maybe if we can remove Bootstrap and create a custom base for our projects, that would speed up the work? So we went happily on our way to do just that. We scrapped Bootstrap, set up Sass mixins, generated a bunch utility classes, and it was a mess!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*B2--RNRk9XmKWGuNRQyh8g.jpeg" /><figcaption>Me trying to explain our new styling setup</figcaption></figure><p>Our designers used slightly different layouts for their projects which forced us to adjust utilities every time or add a lot of custom classes to each project. We could easily fix this problem by adding an extremely large collection of utilities with unused classes being purged and one config file to adjust them. See where I’m going with this train of thought?</p><p>At that point, our team decided it was time to go back to the drawing board. The first step was to research available solutions. I’ve heard about Tailwind before, but only after some personal experimentation was I convinced it was a viable solution to issues we’ve been experiencing. As a company, we reached a point where the best path we could take was reinventing Tailwind. Utilities? Check. Purge? Check. Easy configuration? Check check check.</p><p>Rediscovering Tailwind after our internal trial and error process was a real blessing. We knew what we wanted, now the easy part, right? Right?</p><h3>Getting the team on board</h3><p>We found our solution and just needed to implement it. What could go wrong?</p><p>Making people change their way of doing things is challenging. Some of the team heavily preferred other frameworks like Bootstrap or Bulma. Others on the team were heavily invested in React and wanted to use styled components. Understandably, everyone defaults to the framework and stack they know the best.</p><p>Along with the preference issue, we didn’t have any standards in place to support Tailwind development.</p><p>Switching to Tailwind is unintuitive at first. The biggest question is when to use Tailwind, and when should I use custom classes? After some experimentation, we decided to componentise as much as we could and use Tailwind classes except for couple of edge cases.</p><p>At first, using Tailwind “correctly” was tricky for most of our team. Some of our guys still used custom classes using Tailwind’s @apply. This approach was fortunately eliminated after couple of projects and code reviews sessions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*byl7gvcNPpjl_6puZZUoVQ.png" /><figcaption>The Tailwind Way</figcaption></figure><p>The best method to encourage devs to use Tailwind classes was debugging fully tailwind written code bases. Despite more complex markup, it’s much easier and faster to debug styling issues when only Tailwind classes are used.</p><p>Armed with the knowledge that debugging existing projects will be easier, the team became much more receptive to the idea of fully committing to Tailwind.</p><h3>Why we love Tailwind</h3><h4>One framework to rule them all</h4><p>Our team focuses on delivering quality code. Our definition of “quality code” means little to no bugs, simply maintainable and easy scalability. We’re curious and often want to try the “next big thing”. That’s why we experiment when it makes sense. It’s a challenge to manage multiple stacks (duh), so it’s nice to have one common denominator.</p><p>Our approach to styling is always built on top of Tailwind. This standardised procedure makes it a tad easier to experiment and move components across stacks (should something goes wrong). Thanks to our adoption of Tailwind CSS, we’re more agile in our everyday work.</p><h4>Standardisation with the design team</h4><p>After successful adoption by our technical staff, it made sense to move Tailwind over to our design department. There’s no point in having half the team commit to a framework.</p><p>Since April of 2021, our design team have used Tailwind CSS as the guidelines for every new project. Implementing Tailwind during the design process means we don’t have to deviate from default configuration too much. All we do now is change colours, fonts and adjust box shadows. The naming convention for different styles and colours is the same across the design which helps with collaboration and catching issues with styling early.</p><h3>The bad &amp; ugly of Tailwind</h3><p>Tailwind is not all perfect. Sometimes it’s simply, well, ugly. The markup at first can be overwhelming.</p><p>Just take a look at this Banner markup, and you’ll know what I mean.</p><pre>&lt;div class=&quot;bg-indigo-600&quot;&gt;<br>  &lt;div class=&quot;max-w-7xl mx-auto py-3 px-3 sm:px-6 lg:px-8&quot;&gt;<br>    &lt;div class=&quot;flex items-center justify-between flex-wrap&quot;&gt;<br>      &lt;div class=&quot;w-0 flex-1 flex items-center&quot;&gt;<br>        &lt;span class=&quot;flex p-2 rounded-lg bg-indigo-800&quot;&gt;<br>          &lt;svg ... /&gt;<br>        &lt;/span&gt;<br>        &lt;p class=&quot;ml-3 font-medium text-white truncate&quot;&gt;<br>          &lt;span class=&quot;md:hidden&quot;&gt;<br>            We announced a new product!<br>          &lt;/span&gt;<br>          &lt;span class=&quot;hidden md:inline&quot;&gt;<br>            Big news! We&#39;re excited to announce a brand new product.<br>          &lt;/span&gt;<br>        &lt;/p&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;order-3 mt-2 flex-shrink-0 w-full sm:order-2 sm:mt-0 sm:w-auto&quot;&gt;<br>        &lt;a href=&quot;#&quot; class=&quot;flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-indigo-600 bg-white hover:bg-indigo-50&quot;&gt;<br>          Learn more<br>        &lt;/a&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>The other issue with Tailwind implementation is the initial drop in productivity we’ve noticed. For the first 2–3 projects, our devs had problems with using Tailwind instinctively. It takes time to learn Tailwind to the point that you can easily create markups without looking at the docs.</p><p>The decrease in productivity reverses over time, and we saw a 6–10% productivity jump across our teams using Tailwind after a couple of months.</p><h3>If you’re looking for a new framework, try Tailwind!</h3><p>Tailwind helped us to streamline our workflows and standardise our toolkit. It’s not a panacea for all styling problems, but it turned out to be a perfect fit for <a href="http://cleancommit.io/">Clean Commit</a>.</p><p>When working on new projects, we have one less decision to make. Moving components between projects has never been easier. Our devs can easily switch between different codebases without learning (or relearning) styling practices unique to this project.</p><p>Tailwind has saved a lot of time and our sanity!</p><p><em>Originally published at </em><a href="https://cleancommit.io/blog/why-we-use-tailwind-css-as-our-primary-framework/"><em>https://cleancommit.io</em></a><em> on October 12, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed8994dec949" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/why-we-use-tailwind-css-as-our-primary-framework-ed8994dec949">Why we use Tailwind CSS as our primary framework?</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reacreate Flexible Content with Gatsby & Netlify CMS]]></title>
            <link>https://mrkaluzny.medium.com/reacreate-flexible-content-with-gatsby-netlify-cms-8c34ee308919?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c34ee308919</guid>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[netlifycms]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[jamstack]]></category>
            <category><![CDATA[gatsbyjs]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Fri, 16 Apr 2021 02:08:45 GMT</pubDate>
            <atom:updated>2021-04-16T02:08:45.872Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tC45irTa6xhFK3rs" /><figcaption>Photo by <a href="https://unsplash.com/@flowforfrank?utm_source=medium&amp;utm_medium=referral">Ferenc Almasi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Recreate Flexible Content with Gatsby &amp; Netlify CMS</h3><h3>If you’re a WordPress developer then you must have heard about a plugin called Advanced Custom Fields and a Flexible Content field that allows editors to generate new pages easily.</h3><p>When I started to move more into JAMStack I wanted to recreate ACF’s Flexible Content field in Gatsby. It’s possible to use WordPress as a headless CMS and some headless CMS have implemented some sort of an alternative. Prismic has Slices (unfortunately you can’t create multiple repeatable fields within fields).</p><p><strong>For smaller projects WordPress or Prismic may be too complex. In such cases, I usually go with my favorite flat-file CMS — Netlify CMS.</strong></p><p>Netlify CMS offers everything you need, it’s open-source and free to use. The only thing missing? Flexible Content field. Fortunately, with beta features — Manual Initialization and <a href="https://www.netlifycms.org/docs/beta-features/#list-widget-variable-types">Variable Types for List fields</a>we can easily create a solution that copies ACF’s Flexible Content.</p><h3>Why using flexible content is a great idea?</h3><p>Advanced Custom Fields’ Flexible Content allows editors to <strong>quickly make significant changes without engaging developers.</strong> Creating new pages is a breeze, and optimizing for conversions is easier.</p><p>Using a singular template may not be the best way to organize your content, especially if you want to quickly test new changes. That’s why <strong>component-based, modular design gives you much more flexibility.</strong></p><p><strong>It lowers development and maintenance costs.</strong> Websites are tools that have to generate business value. The better system you build the longer it’ll last without any code changes.</p><h3>Flexible Content with Netlify CMS — configuration</h3><p>Code examples assume usage of Manual Initialization, <a href="https://mrkaluzny.com/blog/dry-netlify-cms-config-with-manual-initialization/">check out this article on DRY Netlify CMS configuration</a> to learn more about that.</p><p>I strongly encourage using that instead of standard configuration for optimal developer experience. Manual Initialization leverages javascript files instead of YAML, which makes it easier to maintain in the long run.</p><p>You can check out my <a href="https://github.com/clean-commit/gatsby-starter-henlo">Gatsby started called Henlo</a> to check out an example of that configuration, and use it as a starter point.</p><p>For each Flexible Content item (I’ll call them sections in the article) we need 2 files. A JSX file to render the section (I tend to place them ‘./src/Sections’ folder) and a configuration file for the CMS (‘./src/cms/sections/‘ folder).</p><h3>Prepare Netlify CMS configuration</h3><p>First, we’ll have to set up a configuration for the collection that we’ll use to create pages with sections.</p><pre><em>import</em> seo <em>from</em> &#39;@/cms/partials/seo&#39;<br><em>import</em> hero <em>from</em> &#39;@/cms/sections/hero&#39;<br>...</pre><pre><em>const</em> services = {<br>  name: &#39;pages&#39;,<br>  label: &#39;Pages&#39;,<br>  editor: {<br>    preview: false,<br>  },<br>  folder: &#39;content/pages&#39;,<br>  slug: &#39;{{slug}}&#39;,<br>  create: true,<br>  fields: [<br>	  {<br>		  label: &#39;Layout&#39;<br>		  name: &#39;layout&#39;<br>		  widget: &#39;hidden&#39;,<br>		  <em>default</em>: &#39;page&#39;,<br>	  }<br>    {<br>      label: &#39;Title&#39;,<br>      name: &#39;title&#39;,<br>      widget: &#39;string&#39;,<br>      required: true,<br>    },<br>    {<br>      label: &#39;Slug&#39;,<br>      name: &#39;slug&#39;,<br>      widget: &#39;string&#39;,<br>      required: true,<br>    },<br>    {<br>      label: &#39;Sections&#39;,<br>      name: &#39;sections&#39;,<br>      widget: &#39;list&#39;,<br>      types: [<br>        hero,<br>        ...<br>      ],<br>    },<br>    seo,<br>  ],<br>}</pre><pre><em>export</em> <em>default</em> services</pre><p>In this example, I’m using a javascript file to generate a collection for Netlify CMS. Check this <a href="https://mrkaluzny.com/blog/dry-netlify-cms-config-with-manual-initialization/">article about Netlify CMS configuration</a> to learn why it’s better than YAML files.</p><p>The most important field to use is layout. I use them as a way to pass the name of the template file used to render that content type.</p><p>As you can see I’ve added 2 partials — SEO partial that handles SEO content and Hero section. Separating these fields into different files makes it easier to maintain components and reuse them across the project.</p><p>Here’s the example configuration of the Hero section.</p><pre><em>const</em> hero = {<br>  label: &#39;Hero&#39;,<br>  name: &#39;hero&#39;,<br>  widget: &#39;object&#39;,<br>  collapsed: false,<br>  fields: [<br>    {<br>      label: &#39;Title&#39;,<br>      name: &#39;title&#39;,<br>      widget: &#39;string&#39;,<br>      required: false,<br>    },<br>    {<br>      label: &#39;Subtitle&#39;,<br>      name: &#39;subtitle&#39;,<br>      widget: &#39;string&#39;,<br>      required: false,<br>    },<br>    {<br>      label: &#39;Content&#39;,<br>      name: &#39;content&#39;,<br>      widget: &#39;markdown&#39;,<br>      required: false,<br>    },<br>  ],<br>}</pre><pre><em>export</em> <em>default</em> hero</pre><p>Now that we have an initial configuration for Netlify CMS we can go into generating pages from our collection.</p><h3>Generating pages using Flexible Content with Gatsby &amp; Netlify</h3><p>Another good practice to follow is to utilize a parent component that manages our sections. This way you can add sections to other templates or pages.</p><h3>Create SectionsGenerator component</h3><p>The idea for the component is pretty simple. I was inspired by a recent project I worked on with Prismic, <a href="https://prismic.io/docs/technologies/tutorial-3-create-homepage-slices-gatsby#4.-update-the-slicezone-component">this component is modeled after SliceZone component</a>.</p><p>Adding a new section is as easy as importing and matching components to section type (name of the object in Netlify CMS config).</p><pre><em>import</em> React <em>from</em> &#39;react&#39;<br><em>import</em> { graphql } <em>from</em> &#39;gatsby&#39;</pre><pre><em>import</em> Hero <em>from</em> &#39;@/Sections/Hero&#39;</pre><pre><em>export</em> <em>default</em> <em>function</em> SectionsGenerator({ sections }) {<br>	<em>const</em> sectionsComponents = {<br>		hero: Hero<br>	}<br>	<br>	<em>const</em> sectionsContent = sections.map((section, key) =&gt; {<br>		<em>const</em> Section = sectionsComponents[section.type]<br>		<em>if</em> (Section) {<br>			<em>return</em> &lt;Section key={key} data={section} /&gt;<br>		}<br>		<em>return</em> &lt;div&gt;{section.type}&lt;/div&gt;<br>	})<br>	<br>	<em>return</em> (<br>		&lt;&gt;<br>			{sectionsContent}<br>		&lt;/&gt;<br>	)<br>}</pre><pre><em>export</em> <em>const</em> query = graphql`<br>  fragment Sections on MarkdownRemarkFrontmatter {<br>    sections {<br>      id<br>      type<br>      title<br>      subtitle<br>      content<br>  }<br>}<br>`</pre><p>Additionally, I recommend creating a graphql fragment within the same file. With a single import, we can pass data to query and render sections to any template page in the project (see in next code example)</p><h3>Prepare a template to render pages</h3><p>Our template has to do 1 thing — fetch sections data and pass them as a prop to the SectionsGeneratorcomponent.</p><p>With this approach, it’s also possible to use a single layout for every page. Using the useStaticQueryhook it&#39;s possible to add additional data to each section.</p><pre><em>import</em> React <em>from</em> &#39;react&#39;<br><em>import</em> { graphql } <em>from</em> &#39;gatsby&#39;</pre><pre><em>import</em> Layout <em>from</em> &#39;@/components/Layout&#39;<br><em>import</em> SectionsGenerator <em>from</em> &#39;@/components/SectionsGenerator&#39;</pre><pre><em>import</em> SEO <em>from</em> &#39;@/components/SEO/Seo&#39;</pre><pre><em>const</em> SectionPageTemplate = ({ data }) =&gt; {<br>  <em>const</em> sections = data.frontmatter.sections<br>  <em>return</em> (<br>    &lt;&gt;<br>      &lt;SectionsGenerator sections={sections} /&gt;<br>    &lt;/&gt;<br>  )<br>}</pre><pre><em>const</em> LandingPage = ({ data }) =&gt; {<br>  <em>return</em> (<br>    &lt;Layout hideNav={true}&gt;<br>      &lt;SEO data={data.page.frontmatter.seo} /&gt;<br>      &lt;SectionPageTemplate data={data.page} /&gt;<br>    &lt;/Layout&gt;<br>  )<br>}</pre><pre><em>export</em> <em>default</em> SectionPage</pre><pre><em>export</em> <em>const</em> sectionsPageQuery = graphql`<br>  query SectionPage($id: String!) {<br>    page: markdownRemark(id: { eq: $id }) {<br>      id<br>      fields {<br>        slug<br>      }<br>      html<br>      frontmatter {<br>        title<br>        ...Sections<br>        ...SEO<br>      }<br>    }<br>  }<br>`</pre><p>By writing a fragment our query stays extremely short regardless of the number of sections the project supports.</p><h3>Configure Gatsby-node to work with Netlify CMS with Flexible Content</h3><p>With all of the components ready we can proceed to the gatsby-node configuration.</p><pre>exports.createPages = ({ actions, graphql }) =&gt; {<br>  <em>const</em> { createPage } = actions</pre><pre>  <em>return</em> graphql(`<br>    {<br>      allMarkdownRemark(limit: 1000) {<br>        edges {<br>          node {<br>            id<br>            fields {<br>              slug<br>            }<br>            frontmatter {<br>              layout<br>              title<br>              slug<br>            }<br>          }<br>        }<br>      }<br>    }<br>  `).then((result) =&gt; {<br>    <em>if</em> (result.errors) {<br>      result.errors.forEach((e) =&gt; console.error(e.toString()))<br>      // return Promise.reject(result.errors);<br>    }</pre><pre>    // Filter out the footer, navbar, and meetups so we don&#39;t create pages for those<br>    <em>const</em> postOrPage = result.data.allMarkdownRemark.edges.filter((edge) =&gt; {<br>	    <em>let</em> layout = edge.node.frontmatter.layout<br>	    <em>return</em> layout == <em>null</em> || layout == &#39;hidden&#39;<br>    })</pre><pre>    postOrPage.forEach((edge) =&gt; {<br>      <em>const</em> id = edge.node.id<br>      <em>let</em> component = path.resolve(<br>        `src/templates/${String(edge.node.frontmatter.layout)}.js`,<br>      )<br>      <em>if</em> (fs.existsSync(component)) {<br>        <em>switch</em> (edge.node.frontmatter.layout) {<br>          <em>case</em> &#39;page&#39;:<br>            createPage({<br>              path: `/${Helper.slugify(edge.node.frontmatter.slug)}/`,<br>              component,<br>              context: {<br>                id,<br>              },<br>            })<br>            <em>break</em><br>            ...<br>        }<br>      }<br>    })<br>  })<br>}</pre><p>To generate correct slugs we have to leverage the slug field added to each page in the collection. This way editors can update the URLs to create lots of pages, even with hierarchy (although it won’t be reflected in the UI of Netlify CMS).</p><p>In my project I tend to use a trailing slash in URLs, this helps to avoid <a href="https://mrkaluzny.com/blog/how-to-optimize-seo-with-gatsby-netlify/">some SEO optimization issues with Gatsby and Netlify</a>.</p><p>I’m using a helper to clean up pages’ URLs and make sure it won’t cause any issues.</p><h3>Watch out for these issues</h3><p>There’s one problem if we try to create a page and call a non-existent element page generation will fail. Why?</p><p><strong>Gatsby infers the type of field based on the content we provide.</strong> If content doesn’t exist for that field the build process fails. To avoid that issue we have to let Gatsby know what to expect.</p><p>We do that but defining types in the gatsby-node.js file. Here&#39;s an example that I wrote when working on new landing pages for Clean Commit&#39;s website.</p><pre>exports.createSchemaCustomization = ({ actions }) =&gt; {<br>  actions.createTypes(`<br>    type Button {<br>      text: String<br>      link: String<br>    }</pre><pre>    type List {<br>      title: String<br>      content: String<br>    }</pre><pre>    type Form {<br>      provider: String<br>      title: String<br>      formid: Int<br>      redirect: String<br>      button: String<br>    }</pre><pre>    type FAQ {<br>      question: String<br>      answer: String<br>    }</pre><pre>    type MarkdownRemarkFrontmatterSections @infer {<br>      id: String<br>      type: String<br>      subheader: String<br>      title: String<br>      subtitle: String<br>      background: String<br>      content: String<br>      variant: String<br>      video: String<br>      bulletpoints: [String]<br>      secondarycontent: String<br>      button: Button<br>      list: [List]<br>      form: Form<br>      faqs: [FAQ]<br>    }<br>  `)<br>}</pre><p>We’ve prepared 17 different sections that our team can use to create new landing pages and services. With defined types, we can safely deploy the website without any issues during the build process.</p><h3>Sections fields naming</h3><p>Creating a Flexible Content experience with Netlify CMS is different than in any other Headless CMS. At this point, there’s no way to query content only for one section. That’s why the naming convention for fields has to be consistent (or you’ll spend a lot of time writing custom types definition).</p><p>That’s why it’s important to reuse the same names and be as consistent as possible across multiple sections. With Clean Commit’s landing pages almost every section uses title, content, subheader, and button fields. So keep that in mind when working on your project!</p><p>If you want to check out how this solution is working and what you can create take a look at Clean Commit’ service pages like <a href="https://cleancommit.io/services/website-development/">website development</a>, <a href="https://cleancommit.io/services/app-development/">app development</a> or <a href="https://cleancommit.io/services/frontend-development/">front-end development</a>.</p><p>Along with my team we created (and actively maintaining) our own <a href="https://github.com/clean-commit/gatsby-starter-henlo">Gatsby Starter for Netlify CMS called Henlo</a> — check it out and show us some love!</p><h3>How to create Flexible Content field in Netlify CMS</h3><ul><li>Use manual initialization to make configuration file management easier.</li><li>Leverage List widget and use types option</li><li>Create a component that will render each section component</li><li>Add that component to templates where you want to use it</li><li>Define types of fields used in sections to avoid build errors with type inference in Gatsby</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c34ee308919" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to optimize SEO with Gatsby & Netlify]]></title>
            <link>https://mrkaluzny.medium.com/how-to-optimize-seo-with-gatsby-netlify-6ff19ab1737c?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ff19ab1737c</guid>
            <category><![CDATA[on-site-seo]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[netlifycms]]></category>
            <category><![CDATA[gatsbyjs]]></category>
            <category><![CDATA[netlify]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Sat, 03 Apr 2021 19:31:37 GMT</pubDate>
            <atom:updated>2021-04-10T00:57:29.066Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9OU58IT2dkygBIzb" /><figcaption>Photo by <a href="https://unsplash.com/@szolkin?utm_source=medium&amp;utm_medium=referral">Sergey Zolkin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Optimizing websites for SEO is a headache for a lot of people out there. Google’s ranking factor consists of many elements. <strong>The most important being the number of links to your pages, followed by the quality of content, core web vitals (performance), and user behavior.</strong></p><p><strong>With performance being one of the most important ranking factors, Gatsby already gives us a leg up</strong>. But the factors above are not the only ones you should care about.</p><p>In February I worked on optimizing both our and our clients’ websites for onsite SEO. I managed to update Clean Commit’s website’s ahrefs score from 77% to 98%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*5-F4gmXw8-x7LS6F.jpg" /><figcaption>Ahrefs score before and after optimization</figcaption></figure><p>In this article, I’ll show you all the boxes you need to check to maximize your Gatsby website SEO potential.</p><h3>Tools to establish the issues with Gatsby SEO.</h3><p><strong>The first thing you should do is focus on optimizing the website’s performance</strong>. That will have a huge impact on your website’s rankings in the long term. I wrote an article for Clean Commit’s blog listing the <a href="https://cleancommit.io/blog/how-to-measure-website-performance/">tools we use to measure performance</a>.</p><p>For SEO there are 2 main tools I use — ahrefs and Google’s built-in Lighthouse test. When releasing websites we aim to achieve 90+ performance on desktop, 60+ performance on mobile, and 99+ when it comes to SEO scores so our lighthouse score looks pretty good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*kzoROW5x6pEnJRv-.jpg" /><figcaption>Our speed score with Gatsby</figcaption></figure><p>Ahrefs provides more detailed analysis regarding potential on-site issues. Here’s the list I worked with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*bkha24yY2JBj-9j_.jpg" /><figcaption>Issues listed by ahrefs</figcaption></figure><p>Let’s start dealing with all the issues!</p><h3>Provide metadata for better CTR with Gatsby</h3><p>Ahrefs brought up issues concerning the meta tags on our website. When creating a Gatsby website it’s important to use a good, reusable SEO component. This component will make sure all the relevant meta tags contain correct data.</p><p>We separate SEO components into 2 the <a href="https://github.com/clean-commit/gatsby-starter-henlo/blob/master/src/components/SEO/DefaultSeo.js">default one</a>, which sets up our head params with Henlo and a smaller component that modifies each page.</p><pre><em>import</em> React <em>from</em> &#39;react&#39;<br><em>import</em> { Helmet } <em>from</em> &#39;react-helmet&#39;<br><em>import</em> { graphql, useStaticQuery } <em>from</em> &#39;gatsby&#39;</pre><pre><em>function</em> SEO({ data, children }) {<br>  <em>const</em> meta = useStaticQuery(graphql`<br>    query MetaDataQuery {<br>      site {<br>        siteMetadata {<br>          title<br>          separator<br>          baseTitle<br>          description<br>          keyword<br>          image<br>        }<br>      }<br>    }<br>  `)</pre><pre>  console.log(data)</pre><pre>  <em>const</em> metadata = meta.site.siteMetadata<br>  <em>const</em> metaDescription = data.description || metadata.description<br>  <em>const</em> title = data.title || metadata.title<br>  <em>const</em> image = data.image<br>    ? `${metadata.siteUrl}${data.image.childImageSharp.fluid.src}`<br>    : metadata.image</pre><pre>  <em>const</em> fullTitle = `${title} ${metadata.separator} ${metadata.baseTitle}`</pre><pre>  <em>return</em> (<br>    &lt;Helmet<br>      title={title}<br>      titleTemplate={`%s ${metadata.separator} ${metadata.baseTitle}`}&gt;<br>      &lt;meta name=&#39;description&#39; content={metaDescription} /&gt;<br>      &lt;meta property=&#39;og:title&#39; content={fullTitle} /&gt;<br>      &lt;meta property=&#39;og:image&#39; content={image} /&gt;<br>      &lt;meta property=&#39;og:description&#39; content={metaDescription} /&gt;<br>      &lt;meta name=&#39;twitter:title&#39; content={fullTitle} /&gt;<br>      &lt;meta name=&#39;twitter:description&#39; content={metaDescription} /&gt;<br>      &lt;meta name=&#39;twitter:image&#39; content={image} /&gt;<br>      {children}<br>    &lt;/Helmet&gt;<br>  )<br>}</pre><pre><em>export</em> <em>default</em> SEO</pre><pre><em>export</em> <em>const</em> query = graphql`<br>  fragment SEO on MarkdownRemarkFrontmatter {<br>    seo {<br>      title<br>      description<br>      image {<br>        childImageSharp {<br>          fluid(maxWidth: 1200, quality: 100) {<br>            ...GatsbyImageSharpFluid_noBase64<br>          }<br>        }<br>      }<br>    }<br>  }<br>`</pre><p>The SEO Component comes with a fragment to load all information required without repeating code, making future changes quicker and easier. You setup SEO partial in <a href="https://mrkaluzny.com/blog/dry-netlify-cms-config-with-manual-initialization/">Netlify CMS using Manual Initialization to reuse it across all content type</a></p><p>Optimizing metadata is important for SEO optimization. <strong>The content of the metadata doesn’t really impact your rankings</strong>, and Google can generate snippets ignoring the provided content. Saying that <strong>good metadata content will impact your click-through rates (CTR).</strong> Think about metadata as a preview of the content, if you can outline the most important information there’s a better chance of visitors clicking your link. <a href="https://jamseotools.com/">Use this tool</a> to make sure your titles and descriptions have correct length and are easily readable.</p><h3>Avoid redundant 301 redirects in Gatsby</h3><p>The biggest issue that I had was 301 redirects. <strong>301 redirects are the correct way to redirect traffic, and shouldn’t affect your search engine optimization efforts directly.</strong> At the same time, 301 redirects add load time and are simply not necessary most of the time. It’s important to make sure there are no 301 redirects present in internal links.</p><p><strong>Out of the box Gatsby sets up paths with trailing slashes.</strong> If you want, <a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-remove-trailing-slashes/">you can remove trailing slashes from paths using gatsby-plugin-remove-trailing-slashes</a>. Some people remove trailing slashes from paths directly in gatsby-node.js, but I would advise against doing it in.</p><p><strong>When using Netlify it’s better to use paths with trailing slashes.</strong> Netlify will match paths to redirect rules regardless of whether or not they contain a trailing slash. Paths without trailing slashes can potentially cause infinite redirect loops and unexpected behaviors.</p><p>To avoid creating accidental redirects make sure you’re using correct paths in Link components.</p><pre>&lt;Link to=&#39;/about&#39;&gt;About us&lt;/Link&gt;</pre><p>This link can cause a 301 redirect (it will on Netlify)</p><pre>&lt;Link to=&#39;/about/&#39;&gt;About us&lt;/Link&gt;</pre><p>This link won’t cause a 301 redirect</p><h3>Avoid redirect chain in Gatsby on Netlify</h3><p>Netlify causes a redirect chain out-of-the-box. It redirects <a href="http://www.domain.com/">http://www.domain.com</a> to <a href="https://www.domain.com/">https://www.domain.com</a> to <a href="https://domain.com/">https://domain.com</a>.</p><p>This redirect is a pretty easy fix. All you have to do is add custom redirects to the _redirects file.</p><pre>https://domain.netlify.app/* https://domain.com/:splat 301!<br>http://www.domain.com/* https://domain.com/:splat 301!<br>http://domain.com/* https://domain.com/:splat 301!</pre><h3>Generate a sitemap for better indexing</h3><p>The next thing you should do is generate a sitemap for better indexing. This would be a mundane task but fortunately, we can leverage Gatsby’s plugins to do the heavy lifting.</p><p>My go-to plugin for sitemaps is <a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-advanced-sitemap/">gatsby-plugin-advanced-sitemap</a>. <strong>If you don’t want to modify the contents of the sitemap, all you have to do is add this plugin to the gatsby-config.</strong> Once your website is built, the sitemap will be available under <a href="https://domain.com/sitemap.xml">https://domain.com/sitemap.xml</a>.</p><p>To make sure Google fetches the website you can use <a href="https://search.google.com/search-console/about">Google Search Console tool</a>. <strong>All you need to do is add the domain, verify it with a TXT record on your DNS.</strong></p><p>After your domain is verified you can navigate to the Sitemap tab under the Index in the left-side navigation. There you can <strong>submit your sitemap’s URL to let Google know your website is ready to be indexed.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*IpPMHy6lTLRIER4O.jpg" /><figcaption>Adding domain to Google Search</figcaption></figure><p>Google’s search console is a great tool to keep an eye on your rankings in Google, average CTR, and detect potential problems with pages.</p><h3>Quick summary for optimizing Gatsby SEO</h3><ol><li>Focus on performance improvements</li><li>Provide metadata information for better CTR</li><li>Avoid unnecessary 301 redirects</li><li>Avoid redirect chain when working with Netlify</li><li>Generate sitemap and submit it to Google Search Console</li></ol><p>If you want to improve your experience when working with Gatsby read <a href="https://mrkaluzny.com/blog/dry-netlify-cms-config-with-manual-initialization/">this article on DRY configuration for Netlify CMS &amp; Gatsby</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ff19ab1737c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Full-text search with Gatsby and Netlify CMS]]></title>
            <link>https://levelup.gitconnected.com/full-text-search-with-gatsby-and-netlify-cms-5a2a77d730de?source=rss-3c0fb3dd5956------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a2a77d730de</guid>
            <category><![CDATA[gatsby]]></category>
            <category><![CDATA[netlifycms]]></category>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[jamstack]]></category>
            <category><![CDATA[full-text-search]]></category>
            <dc:creator><![CDATA[Wojciech Kałużny]]></dc:creator>
            <pubDate>Sat, 03 Apr 2021 19:25:16 GMT</pubDate>
            <atom:updated>2021-04-06T15:20:57.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9aBA0WkjI0tFLFcSK_zDpQ.jpeg" /></figure><p>Full-text search refers to techniques for searching a single document or a collection in a full-text database. Full-text search is distinguished from searches based on metadata or on parts of the original texts represented in databases (such as titles, abstracts, selected sections, or bibliographical references).</p><p>Full-text search allows users to retrieve higher quality results than using other methods. During the full-text search, a search engine examines all of the words in every stored document as it tries to match search criteria.</p><p>Implementing a full-text search into Gatsby is quite painless to set up. I’ve experimented with different plugins but decided to use Flexsearch (easiest to implement and set up).</p><h3>Prerequisites</h3><p>In this example, I’m presenting an implementation for Gatsby’s website using Netlify CMS to manage content. When using other CMS, the implementation may vary.</p><p>First, we need to install gatsby-plugin-flexsearch</p><pre>$ yarn add gatsby-plugin-flexsearch</pre><p>After that, we have to initialize the plugin in gatsby-config and configure which attributes we want to include.</p><pre>{<br>      resolve: &#39;gatsby-plugin-flexsearch&#39;,<br>      options: {<br>        languages: [&#39;en&#39;],<br>        type: &#39;MarkdownRemark&#39;,<br>        fields: [<br>          {<br>            name: &#39;id&#39;,<br>            indexed: false,<br>            resolver: &#39;id&#39;,<br>            store: true,<br>          },<br>          {<br>            name: &#39;html&#39;,<br>            indexed: true,<br>            resolver: &#39;internal.content&#39;,<br>            attributes: {<br>              encode: &#39;balance&#39;,<br>              tokenize: &#39;strict&#39;,<br>              threshold: 0,<br>              resolution: 3,<br>              depth: 3,<br>            },<br>            store: true,<br>          },<br>          {<br>            name: &#39;title&#39;,<br>            indexed: true,<br>            resolver: &#39;frontmatter.title&#39;,<br>            attributes: {<br>              encode: &#39;extra&#39;,<br>              tokenize: &#39;full&#39;,<br>              threshold: 1,<br>              resolution: 3,<br>            },<br>            store: true,<br>          },<br>          {<br>            name: &#39;description&#39;,<br>            indexed: true,<br>            resolver: &#39;frontmatter.description&#39;,<br>            attributes: {<br>              encode: &#39;icase&#39;,<br>              tokenize: &#39;forward&#39;,<br>              threshold: 2,<br>              depth: 3,<br>            },<br>            store: true,<br>          },<br>          {<br>            name: &#39;type&#39;,<br>            indexed: false,<br>            resolver: &#39;frontmatter.type&#39;,<br>            store: true,<br>          },<br>          {<br>            name: &#39;slug&#39;,<br>            indexed: false,<br>            resolver: &#39;fields.slug&#39;,<br>            store: true,<br>          },<br>          {<br>            name: &#39;layout&#39;,<br>            indexed: false,<br>            resolver: &#39;frontmatter.layout&#39;,<br>            store: true,<br>          },<br>        ],<br>      },<br>    },</pre><p>In the example above, I declared custom attributes to be indexed by flex search (id, layout, and slug) that are important for displaying results snippets and have to be available from the search component.</p><p>After restarting the development server flex search index and the store will be attached to the window object of your browser.</p><h3>Search component with snippets</h3><p>Right now, our Gatsby website will have flex search enabled. So far, so good! Now we have to enable users to perform searches against our content.</p><p>To do that, we need a search component! The most important part is the search function itself. If you want to check out the full component <a href="https://gist.github.com/mrkaluzny/f53a0323621a670e86a51dad7c78b804">take a look at this gist</a></p><pre>getSearchResults(query) {<br>    <em>var</em> index = window.__FLEXSEARCH__.en.index<br>    <em>var</em> store = window.__FLEXSEARCH__.en.store<br>    <em>if</em> (!query || !index) {<br>      <em>return</em> []<br>    } <em>else</em> {<br>      <em>var</em> results = []<br>      Object.keys(index).forEach((idx) =&gt; {<br>        results.push(...index[idx].values.search(query))<br>      })</pre><pre>      results = Array.from(<em>new</em> Set(results))</pre><pre>      <em>var</em> nodes = store<br>        .filter((node) =&gt; (results.includes(node.id) ? node : <em>null</em>))<br>        .map((node) =&gt; node.node)</pre><pre>      <em>return</em> nodes<br>    }<br>  }</pre><p>To search our documents, we can create a simple function that takes the user’s input and performs a search using the Flexsearch index and store.</p><p>First, we create an array for results. Then we can check each index for the querying user searched for and return the matched values. Then we’re using the results array to filter Flexsearch store and return objects that are matching our query. The function is returning nodes containing information about documents that matched the query.</p><p>These nodes can then be used to render snippets for each search result. You can check out the full implementation on <a href="https://dionysus.events/">Dionysus website we worked on last month</a></p><p>Psst! If you’re looking for a great Gatsby starter with Tailwind and Netlify CMS you have to check out <a href="https://henlo.netlify.app/">Henlo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a2a77d730de" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/full-text-search-with-gatsby-and-netlify-cms-5a2a77d730de">Full-text search with Gatsby and Netlify CMS</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>