<?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 Nirmal Parmar on Medium]]></title>
        <description><![CDATA[Stories by Nirmal Parmar on Medium]]></description>
        <link>https://medium.com/@nirmalparmar48?source=rss-e349c7881128------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Pk1M5O-rccvzFOC_DqGz1A.jpeg</url>
            <title>Stories by Nirmal Parmar on Medium</title>
            <link>https://medium.com/@nirmalparmar48?source=rss-e349c7881128------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:36:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nirmalparmar48/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[Why You Should Not Use Google Analytics in 2026]]></title>
            <link>https://medium.com/@nirmalparmar48/why-you-should-not-use-google-analytics-in-2026-145e85a1336e?source=rss-e349c7881128------2</link>
            <guid isPermaLink="false">https://medium.com/p/145e85a1336e</guid>
            <category><![CDATA[data-sense]]></category>
            <category><![CDATA[plausible]]></category>
            <category><![CDATA[web-analytics]]></category>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[umami]]></category>
            <dc:creator><![CDATA[Nirmal Parmar]]></dc:creator>
            <pubDate>Fri, 06 Nov 2026 10:43:21 GMT</pubDate>
            <atom:updated>2026-11-06T10:43:21.532Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6BKIg2WFciMTxnJM5oKgig.jpeg" /></figure><h3>If you are looking for Google Analytics alternative you have come to right place.</h3><p>Google Analytics was the default long before most of us built our first website. Then Google shut down Universal Analytics, pushed everyone onto GA4, and honestly the whole thing changed shape overnight.</p><p>Here’s the problem though. Most people never actually chose it. A developer pasted the snippet years ago, a theme had a field for it, a tutorial said “step one: install Google Analytics.” And it’s been sitting there ever since.</p><p>I build analytics for a living, so I think about this more than is healthy. What’s below is the short list of reasons I’d stop using it this year.</p><p>Quick note before we start. I build Datasense, a Google Analytics alternative, so yes, I’m biased. I’ll tell you when Google Analytics is still the right call, because sometimes it is.</p><p><strong>Before going into the list, I have something for you</strong></p><p><strong>Datasense</strong> ~ Analytics you can read in ten seconds</p><p>Under 4 KB, cookieless if you want it, revenue by traffic source and JavaScript errors on one page. Free to start at <a href="https://usedatasense.com/">usedatasense.com</a>.</p><p>Let’s get into the list:</p><h3>1. It’s missing a big chunk of your visitors</h3><p>This is the one that bugs me most, and most people have no idea it’s happening.</p><p>Popular ad blockers like uBlock Origin, and browsers like Brave, block Google Analytics by default. Safari limits how long tracking cookies live, so a returning visitor can look brand new. If your audience is technical, the gap can be huge.</p><p>Google’s fix is Consent Mode, which fills the holes with modeled estimates. Clever, sure. But it means part of your dashboard is a guess.</p><p><strong>Why It Matters:</strong> You’re deciding where to spend time and money based on numbers that are partly missing and partly guessed.</p><p><strong>The fix:</strong> Use a tool that can send data through your own domain, so blockers let it through.</p><h3>2. You need a cookie banner, and people click “Reject”</h3><p>In the EU and UK, Google Analytics usually needs consent before it runs. So you add a banner. Your visitors hate it. A lot of them click “Reject,” or just ignore it.</p><p>Every one of those visits disappears from your data. You annoyed them <em>and</em> you didn’t count them.</p><p><strong>Why It Matters:</strong> A banner hurts the first impression of your site, and it makes your numbers worse at the same time.</p><p><strong>The fix:</strong> A cookieless analytics tool counts visitors without storing anything on their device, so there’s no banner needed for analytics.</p><h3>3. It slows down your site</h3><p>The Google tag is around 150 KB. On your fast laptop, you won’t notice. On a cheap phone with patchy 4G, which is how a lot of the world browses, you will.</p><p>The irony? Google uses page speed as a ranking signal. A Google script can make your site slower in a way Google Search then measures.</p><p><strong>Why It Matters:</strong> Slow pages lose visitors, and they can cost you rankings.</p><p><strong>The fix:</strong> Modern analytics scripts weigh a few kilobytes. That’s roughly 40x smaller.</p><h3>4. GA4 is built for analysts, not for you</h3><p>Remember when Universal Analytics got switched off in 2023? The old reports vanished, and in 2024 the old data was deleted too.</p><p>GA4 is a different beast. Everything is an “event.” Goals became “conversions,” then got renamed again to “key events.” Simple questions need custom explorations. And by default, the detailed data behind them is kept for just two months.</p><p>Why It Matters: If it takes 20 minutes to find “top pages last week,” you’ll stop looking. A tool you don’t open isn’t giving you insight. It’s giving you a chart.</p><p>The fix: Look for one simple page: visitors, pages, sources, countries. Pick a date range and you’re done.</p><h3>5. It doesn’t tell you what makes money</h3><p>The question you actually care about: <em>which traffic turns into paying customers?</em></p><p>Google Analytics can answer it, but only after you set up ecommerce tracking and build the reports yourself. Most people start that project and never finish it.</p><p>And if your checkout button breaks for every Safari user? GA won’t tell you. You’ll just watch sales drop and guess why.</p><p>Why It Matters: Visits don’t pay the bills. Knowing which blog post or tweet brought in revenue does.</p><p>The fix: Use a tool that connects to Stripe or your payment provider and shows revenue right next to each traffic source.</p><h3>6. You’re not the customer</h3><p>Google is an ad company. Google Analytics is free because it fits that business.</p><p>None of this is a secret. But ask yourself one question: <em>if I showed my visitors exactly where their data goes, would they be okay with it?</em></p><p>Why It Matters: Your visitors trust you, not Google. Your analytics choice is part of that trust.</p><p>The fix: Choose a tool whose business is analytics, where you’re the paying customer.</p><h3>A quick note on being fair</h3><p>Google Analytics still makes sense in a few cases. Keep it if you spend real money on Google Ads, if you run a massive site and need it free, or if your data team already lives in BigQuery.</p><p>For everyone else, blogs, SaaS products, online stores, portfolios, small businesses, there are better options now: Plausible, Fathom, Simple Analytics, and the one I build, Datasense.</p><p>You don’t have to rip anything out today. Add the new tool next to Google Analytics, run both for a month, and compare. Most people are surprised by how many visitors GA was missing. Then export what you want to keep and remove the Google tag.</p><p>The tools worth switching to all share a trait. They don’t give you more reports. They give you fewer numbers, and numbers you can actually trust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=145e85a1336e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 5 Web Analytics Tools]]></title>
            <link>https://medium.com/@nirmalparmar48/top-5-web-analytics-tools-a3b9b1472114?source=rss-e349c7881128------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3b9b1472114</guid>
            <dc:creator><![CDATA[Nirmal Parmar]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 08:26:53 GMT</pubDate>
            <atom:updated>2026-10-22T08:26:53.661Z</atom:updated>
            <content:encoded><![CDATA[<h3>What to use in 2026 if you want to know who’s on your site, where they came from, and what broke</h3><p>Most people don’t need “more analytics.” They need to open one page and answer three questions quickly:</p><ol><li>How many people are on my site, and where did they come from?</li><li>Which pages and channels actually turn into signups or sales?</li><li>Is something broken that I don’t know about?</li></ol><p>For years the default answer was Google Analytics. It’s free and powerful, but GA4 is built for marketing teams running ad campaigns, not for a founder checking traffic between meetings. Since then a wave of lighter, privacy-friendly tools has shown up, and they’re good enough now that the choice matters.</p><p>Here are the five I’d look at in 2026, what each one does best, and who should pick it.</p><h3>1. Datasense: web analytics, errors, session replay and revenue on one page</h3><p>Best for: indie hackers, SaaS founders and small product teams who want one simple dashboard instead of four tools.</p><p>Why it’s #1:</p><ul><li>Realtime visitors, updated every second</li><li>JavaScript errors next to your traffic: the last 100 per site, with stack trace and browser</li><li>Revenue by traffic source, from Stripe, Dodo Payments or any provider</li><li>Session replay: 5,000 recordings a month on Pro</li><li>Visitor journeys: every page a visitor saw, visit by visit</li><li>AI crawler tracking: see which AI bots read your pages</li><li>First-party proxy to get past ad blockers, with recipes for Next.js, Vercel, Netlify, Cloudflare and Nginx</li><li>Goals with one line: window.datasense(&quot;signup&quot;)</li><li>CSV and JSON export for any date range</li><li>Script under 3 KB, with an optional cookieless mode</li></ul><p>Pricing: Free for 10k pageviews a month. Pro: $9/month for 100k pageviews. Team: $29/month for 1M pageviews.</p><p>Not for you if: you need open source or self-hosting.</p><p>👉 <a href="https://usedatasense.com/">usedatasense.com</a></p><h3>2. Google Analytics 4</h3><p>Best for: marketing teams running Google Ads.</p><p>Strengths: It’s free, and it connects deeply with Google Ads, BigQuery and Looker Studio.</p><p>Weaknesses:</p><ul><li>The reports are complex, so simple questions often need custom reports</li><li>It uses cookies, so you usually need a consent banner in the EU and UK</li><li>The script is about 150 KB, and most ad blockers block it</li></ul><p>Pick it if ad-to-sale attribution is what you care about most.</p><p>👉 <a href="https://analytics.google.com/analytics/web/provision/#/provision">https://analytics.google.com/analytics</a></p><h3>3. Plausible</h3><p>Best for: teams that need open source or EU hosting.</p><p>Strengths: It’s cookieless, the script is under 3 KB, you can self-host it, and it imports your old GA data.</p><p>Weaknesses:</p><ul><li>No free plan, only a 30-day trial</li><li>$9/month buys just 10k pageviews</li><li>No error tracking, and the realtime view refreshes about every 30 seconds</li></ul><p>Pick it if open source is a hard requirement.</p><p>👉 <a href="https://plausible.io/">https://plausible.io/</a></p><h3>4. PostHog</h3><p>Best for: product teams running experiments.</p><p>Strengths: Analytics, session replay, feature flags, A/B tests and SQL in one platform, with 1M events a month free.</p><p>Weaknesses:</p><ul><li>The script is about 57 KB</li><li>You have to build insights before the dashboard tells you much</li><li>Pay-as-you-go pricing is hard to predict</li></ul><p>Pick it if you need feature flags and experiments, not just traffic numbers.</p><p>👉 <a href="https://posthog.com/">https://posthog.com/</a></p><h3>5. Amplitude</h3><p>Best for: growth and product teams studying funnels, retention and cohorts.</p><p>Strengths: Deep behavioral analytics, with funnels, retention, cohorts, session replay and experiments. The free plan covers 2M events a month, and no card is needed.</p><p>Weaknesses:</p><ul><li>It’s built for product analytics, not website traffic, so simple questions like top pages and sources take more setup</li><li>You have to plan your event tracking before the reports are useful</li><li>Pricing for bigger plans goes through sales</li><li>It uses cookies by default, so you usually need a consent banner</li></ul><p>Pick it if you need to understand what users do inside your product over weeks and months.</p><p>👉 <a href="https://amplitude.com/">https://amplitude.com/</a></p><h3>Quick comparison</h3><p>Datasense: free plan · $9 for 100k pageviews · errors ✅ · revenue ✅ · replay ✅ · proxy ✅ · under 3 KB</p><p>Google Analytics 4: free · cookie banner needed · errors ❌ · about 150 KB</p><p>Plausible: trial only · $9 for 10k pageviews · errors ❌ · open source ✅ · under 3 KB</p><p>PostHog: 1M events free · usage-based · errors ✅ · replay ✅ · about 57 KB</p><p>Amplitude: 2M events free · sales-led above Plus · errors ❌ · replay ✅ · funnels and cohorts ✅</p><p><em>Prices and features as of October 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3b9b1472114" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top AI Marketing Tools in 2026: The Shift to “On-Brand” Generation]]></title>
            <link>https://medium.com/@nirmalparmar48/top-ai-marketing-tools-in-2026-the-shift-to-on-brand-generation-d00dc24f2dd4?source=rss-e349c7881128------2</link>
            <guid isPermaLink="false">https://medium.com/p/d00dc24f2dd4</guid>
            <dc:creator><![CDATA[Nirmal Parmar]]></dc:creator>
            <pubDate>Sat, 13 Jun 2026 05:55:17 GMT</pubDate>
            <atom:updated>2026-06-13T05:55:17.352Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been in marketing for the last few years, you know the struggle: AI tools have been incredible for speed, but terrible for brand consistency. We’ve all spent hours wrestling with generic-looking AI images and robotic copy that sounds like everyone else.</p><p>But in 2026, the landscape has completely shifted. AI has moved past raw generation and into <strong>brand-specific intelligence</strong>. Today’s best tools don’t just create content; they learn your brand’s unique “DNA”, your colors, fonts, voice, and visual aesthetic and generate assets that look and sound exactly like you.</p><p>Whether you’re an e-commerce brand scaling up or an agency juggling multiple clients, here are the top AI marketing tools you need to stay ahead in 2026.</p><h3>1. PerfectPhotoAI: Best for On-Brand Product Photography &amp; Creatives</h3><p>For e-commerce brands, visual consistency is everything and traditional photoshoots are expensive and slow. <a href="https://perfectphotoai.com/"><strong>PerfectPhotoAI</strong></a> has emerged as a powerhouse for generating studio-quality, brand-consistent visual content at scale.</p><p>Operating as an advanced on-brand content generator, PerfectPhotoAI completely eliminates the “generic AI” look. Instead of spending thousands on a studio setup, you can upload basic product shots and have the tool generate flawless lifestyle imagery, ad creatives, and social media assets that strictly adhere to your brand’s visual identity.</p><p><strong>Why it wins in 2026:</strong></p><ul><li><strong>True Brand Alignment:</strong> It doesn’t just generate images; it understands your brand’s specific aesthetic, lighting preferences, and styling.</li><li><strong>Massive Cost Savings:</strong> Replaces the need for expensive location shoots and post-production editing.</li><li><strong>Platform-Ready Outputs:</strong> Instantly generates visuals formatted for Instagram, TikTok, Facebook Ads, and web banners.</li></ul><h3>2. Google Pomelli: Best for Automated Campaign Generation</h3><p>Launched late last year by Google Labs and DeepMind, <strong>Pomelli</strong> has made waves by introducing the concept of “Business DNA.” Instead of manually uploading brand guidelines, you simply feed Pomelli your website URL.</p><p>The tool scans your site, learns your tone of voice, typography, and color palettes, and then generates full, multi-channel marketing campaigns.</p><p><strong>Why it wins in 2026:</strong></p><ul><li><strong>Frictionless Onboarding:</strong> Just paste a URL and let the AI extract your brand identity.</li><li><strong>Campaign Thinking:</strong> It generates cohesive assets across different mediums (ads, emails, social posts) rather than just isolated images.</li></ul><h3>3. Jasper AI: Best for Brand-Voice Copywriting</h3><p>While Jasper has been a staple in AI writing for a while, its 2026 iteration is heavily focused on brand memory. Jasper allows you to build out highly detailed “Brand Voices” by feeding it your best-performing content, company wikis, and style guides.</p><p>When you need an email sequence or a blog post, Jasper automatically applies your specific tone, industry vocabulary, and formatting rules, meaning your copy needs far less human editing before hitting “publish.”</p><p><strong>Why it wins in 2026:</strong></p><ul><li><strong>Enterprise-Grade Memory:</strong> Keeps multiple brand voices distinct, which is perfect for agencies.</li><li><strong>Cross-Platform Integration:</strong> Integrates directly into your CMS and email platforms.</li></ul><h3>4. Gumloop: Best for Agentic AI Automations</h3><p>Creating the content is only half the battle; distributing and analyzing it is the other. <strong>Gumloop</strong> is the breakout star of 2026 for AI marketing automation. It acts as an “agentic” platform, meaning you can build AI agents to handle complex, multi-step marketing workflows.</p><p>You can set up Gumloop to automatically scrape competitor pricing, draft a responsive counter-offer email sequence, and queue it up in your CRM all while you sleep.</p><p><strong>Why it wins in 2026:</strong></p><ul><li><strong>Replaces Manual Work:</strong> Connects the dots between your content generation tools and your CRM/Analytics stack.</li><li><strong>No-Code Workflows:</strong> Easy drag-and-drop interface for building complex AI operations.</li></ul><h3>5. HeyGen: Best for AI Video &amp; Talking Heads</h3><p>Video continues to dominate social feeds, and <strong>HeyGen</strong> is leading the charge in making video production scalable. It allows you to create highly realistic digital avatars (or clone yourself) to produce talking-head videos purely from text scripts.</p><p>For product tutorials, localized ad campaigns, or personalized cold outreach, HeyGen allows you to spin up professional video content without ever setting up a camera or a microphone.</p><p><strong>Why it wins in 2026:</strong></p><ul><li><strong>Flawless Lip Syncing:</strong> The avatar movements and voice generation are virtually indistinguishable from real humans.</li><li><strong>Instant Localization:</strong> Translate your video into dozens of languages with matching lip movements in one click.</li></ul><h3>The Verdict</h3><p>The era of prompting generic AI is over. The marketers who win in 2026 will be the ones who leverage tools that integrate deeply with their unique brand identity.</p><p>If you’re spending too much time and money trying to get your product visuals to look professional and on-brand, start by upgrading your visual pipeline. <strong>Head over to </strong><a href="https://perfectphotoai.com/"><strong>PerfectPhotoAI.com</strong></a><strong> to see how easy it is to scale your brand’s photography without losing your unique aesthetic.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d00dc24f2dd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t Let Heavy Images Slow Down Your Website!]]></title>
            <link>https://medium.com/@nirmalparmar48/dont-let-heavy-images-slow-down-your-website-1f3058233db0?source=rss-e349c7881128------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f3058233db0</guid>
            <category><![CDATA[image-optimization]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[image-compression]]></category>
            <category><![CDATA[background-remove]]></category>
            <category><![CDATA[web-optimization]]></category>
            <dc:creator><![CDATA[Nirmal Parmar]]></dc:creator>
            <pubDate>Mon, 01 Sep 2025 20:18:16 GMT</pubDate>
            <atom:updated>2025-09-01T20:18:16.494Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever click on a website and just sit there, waiting for it to load? It’s frustrating, right? Most of the time, the culprit isn’t your internet connection; it’s often the website’s images. If they’re too big or weren’t optimized, they can make your site feel sluggish, and a slow site means people just click away.</p><p>The good news is you don’t need to be a tech wizard to fix this. Making a few simple tweaks can dramatically speed up your site and keep visitors from leaving. Let’s talk about how to do it. Beginners Guide</p><h3>1. Compress Your Images Without Sacrificing Quality</h3><p>Think of it like this: your camera takes a high-res photo that’s way bigger than you’ll ever need for your website. By compressing your images, you can shrink their file size without losing that crisp, clear look. I personally use a simple tool to <a href="https://resizeimages.org/compress-image">Compress Images</a>.</p><h3>2. Size Your Images for Where They’ll Be Used</h3><p>Have you ever uploaded a huge photo to your blog only to have it show up as a tiny thumbnail? You’re basically forcing your visitors to download a huge file for no reason.</p><p>A better approach is to resize your photos to the exact dimensions you need. If your blog post image is 800 pixels wide, make sure the photo you upload is also 800 pixels wide. This is a small step that can save a lot of load time and make your page look much cleaner. Use this <a href="https://resizeimages.org/resize-image">image resizer</a>.</p><h3>3. Remove Distracting Backgrounds</h3><p>Sometimes, a simple or transparent background is all you need. Think about product shots or profile photos, they often look better and more professional without a busy background.</p><p>Using a <a href="https://resizeimages.org/remove-bg">background remover</a> tool can help you strip out those visual distractions, leaving you with a lightweight, polished image. This makes your page look cleaner and helps it load more efficiently.</p><h4>The Bottom Line</h4><p>Optimizing your images is one of the easiest ways to improve your website’s performance. It’s not just a technical detail; it’s about making your site a better experience for anyone who visits.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f3058233db0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a Next.js 15 App on AWS S3 + CloudFront 2025]]></title>
            <link>https://medium.com/@nirmalparmar48/deploying-a-next-js-app-on-aws-s3-cloudfront-59a62d965317?source=rss-e349c7881128------2</link>
            <guid isPermaLink="false">https://medium.com/p/59a62d965317</guid>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[cloudfront]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Nirmal Parmar]]></dc:creator>
            <pubDate>Tue, 25 Feb 2025 21:20:56 GMT</pubDate>
            <atom:updated>2025-02-27T16:06:37.922Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*neoHeYzw-Fh0HLNtSvpiVA.png" /></figure><p>Next.js is a powerful React framework that enables static site generation (SSG) and server-side rendering (SSR). In this guide, we’ll walk you through deploying your Next.js app on AWS S3 and serving it globally using CloudFront.</p><p>Checkout my <a href="https://www.jsonreader.com/">Json Reader</a> Nextjs App deployed using s3 + Cloudfront:<br><a href="https://www.jsonreader.com/">https://www.jsonreader.com</a></p><h3>Step 1: Build Your Next.js App</h3><p>Since we are deploying a static version of the app, we need to generate a static build using next build.</p><p>Run the following commands in your Next.js project:</p><pre>npm run build</pre><p>This will create an out directory with the fully static version of your site.</p><h3>Step 2: Create an S3 Bucket</h3><ol><li>Go to the AWS S3 console.</li><li>Click <strong>Create Bucket</strong>.</li><li>Choose a unique bucket name.</li><li>Select a region closest to your target audience.</li><li>Uncheck “Block all public access” (we will configure this later).</li><li>Click <strong>Create bucket</strong>.</li><li>Upload all the file in out directory in s3 bucket.</li></ol><h4>Set Bucket as a Static Website</h4><ol><li>Go to your S3 bucket settings.</li><li>Enable <strong>Static website hosting</strong>.</li><li>Set the <strong>Index document</strong> to index.html.</li><li>Set redirection rules</li></ol><pre>[<br>    {<br>        &quot;Condition&quot;: {<br>            &quot;HttpErrorCodeReturnedEquals&quot;: &quot;404&quot;<br>        },<br>        &quot;Redirect&quot;: {<br>            &quot;HttpRedirectCode&quot;: &quot;301&quot;,<br>            &quot;Protocol&quot;: &quot;https&quot;,<br>            &quot;ReplaceKeyWith&quot;: &quot;index.html&quot;<br>        }<br>    }<br>]</pre><p>5. Go to Permission tab of bucket and set bucket policy as:</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;PublicReadGetObject&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: &quot;*&quot;,<br>            &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>            &quot;Resource&quot;: &quot;arn:aws:s3:::[bucket name]/*&quot;<br>        }<br>    ]<br>}</pre><p>Replace [bucket name] with your bucket name.</p><h3>Step 3: Set Up CloudFront for Global Distribution</h3><ol><li>Go to the AWS CloudFront console.</li><li>Click <strong>Create Distribution</strong>.</li><li>Under <strong>Origin</strong>, select your S3 bucket.</li><li>For <strong>Origin Access</strong>, select “Public (legacy)” or configure Origin Access Control (OAC) for better security.</li><li>In the <strong>Default Root Object</strong>, enter index.html.</li><li>Click <strong>Create Distribution</strong>.</li></ol><p>Once CloudFront is deployed, it will provide a domain like xxxxxxxx.cloudfront.net. Do explore attaching your domain to cloudfront. Let me know in comment if you want article on that.</p><p>Now we need cloudfront function to target specific html file for every routes.</p><ol><li>Go to Cloudfront functions.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*RuOtNlbwh5-EDRsFYy9rqQ.png" /></figure><p>2. Create function</p><p>3. Give name as URLwrite and select runtime as cloudfront-js-2.0</p><p>4. Paste following function</p><pre>function handler(event) {<br>    var request = event.request;<br>    var uri = request.uri;<br><br>    // If the URI is &#39;/&#39;, serve index.html<br>    if (uri === &#39;/&#39;) {<br>        request.uri = &#39;/index.html&#39;;<br>    }<br>    // If URI doesn&#39;t end with .html and isn&#39;t a file (doesn&#39;t contain a dot), append .html<br>    else if (uri.slice(-5) !== &#39;.html&#39; &amp;&amp; uri.indexOf(&#39;.&#39;) === -1) {<br>        request.uri = uri + &#39;.html&#39;;<br>    }<br><br>    return request;<br>}</pre><p>5. Go to publish tab and publish the function.</p><p>6. Now go to Cloudfront Distribution we created in previous step.</p><p>7. Go to Behavior tab.</p><p>8. Edit/Create behavior.</p><p>9. Go to functions associations</p><p>10. For <strong>Viewer request </strong>select Cloudfront function.</p><p>11. Under function ARN select URLRewrite.</p><p>12. Save changes.</p><h3>Verify Deployment</h3><p>Visit your CloudFront URL (xxxxxxxx.cloudfront.net). Happy coding!</p><p>Do checkout <a href="https://www.jsonreader.com/">jsonreader.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59a62d965317" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>