DEV Community

Cover image for A Black Friday checklist for your Next.js landing page (tested on Next.js 16)
Nando Septian Husni
Nando Septian Husni

Posted on

A Black Friday checklist for your Next.js landing page (tested on Next.js 16)

Black Friday traffic comes in short bursts. Someone shares your link in a newsletter, a deals list or a group chat, a few hundred people click within an hour, and most of them have never seen your site before. They decide fast, so small problems cost more that week than any other.

I went through my own Next.js landing page before adding a Black Friday code and wrote down what I checked. Every code sample below was built and tested in a static-export project on Next.js 16.4.6 and React 19.3.

1. Put the discount code in the link

Every extra step at checkout loses buyers, and "copy this code, then paste it at checkout" is two steps. The common hosted checkouts can pre-fill the code from the URL:

Checkout Link with the code applied
Gumroad https://you.gumroad.com/l/product/CODE
Lemon Squeezy https://store.lemonsqueezy.com/checkout/buy/VARIANT_ID?checkout[discount_code]=CODE
Stripe Payment Links https://buy.stripe.com/...?prefilled_promo_code=CODE

One Stripe catch, from their docs: by default, Payment Links create guest customers for one-time payments, so a promotion code limited to first-time orders won't work as expected. Try your exact code in test mode before you share the link.

Keep the code and the end date in one file, so the banner and every buy button agree:

// src/config/deal.ts
export const deal = {
  code: "BF40",
  label: "40% off until Dec 1",
  endsAt: "2026-12-02T00:00:00Z", // first moment the deal is over
};

type Provider = "gumroad" | "lemonsqueezy" | "stripe";

/** Adds the discount code to a checkout link while the deal is on. */
export function checkoutUrl(base: string, provider: Provider, now = new Date()) {
  if (now >= new Date(deal.endsAt)) return base;
  if (provider === "gumroad") {
    const url = new URL(base);
    url.pathname = `${url.pathname.replace(/\/$/, "")}/${deal.code}`;
    return url.toString();
  }
  const param = provider === "stripe" ? "prefilled_promo_code" : "checkout[discount_code]";
  return `${base}${base.includes("?") ? "&" : "?"}${param}=${deal.code}`;
}
Enter fullscreen mode Exit fullscreen mode

A buy button then uses checkoutUrl("https://you.gumroad.com/l/product", "gumroad"). After the end date the same call returns the plain link (with one catch for static exports, covered in #7).

2. Tag every link you share

In a deal week you share the same page in many places. Links opened from email apps and chat apps often arrive without a referrer, so your analytics count them as direct visits. UTM tags fix that:

https://your-site.com/?utm_source=newsletter&utm_medium=email&utm_campaign=bf2026
https://your-site.com/?utm_source=x&utm_medium=social&utm_campaign=bf2026
https://your-site.com/?utm_source=deals-list&utm_medium=referral&utm_campaign=bf2026
Enter fullscreen mode Exit fullscreen mode

Plausible, Umami and GA4 group visits by these tags. Keep the values short, lowercase and consistent.

The sale itself happens on the checkout's domain, where your analytics can't see it. Send an event when someone clicks a buy button, then compare those clicks with the sales in your checkout dashboard.

3. Let browsers cache your build files

Next.js puts a content hash in every file name under /_next/static/, so the file at a given URL never changes. Static hosts don't know that. By default, Cloudflare Pages sends Cache-Control: public, max-age=0, must-revalidate (docs), which makes the browser ask the server about every file on every visit. I checked my own demo site while writing this, and its hashed CSS file came back with exactly that header.

Cloudflare Pages and Netlify read a _headers file from the output folder. Put it in public/ and the static export copies it into out/:

# public/_headers
/_next/static/*
  Cache-Control: public, max-age=31536000, immutable
Enter fullscreen mode Exit fullscreen mode

Leave HTML pages on the default, so a new deploy (including the one that removes your banner) shows up right away. First visits don't get faster, but people who come back to compare before buying, which is common in a deal week, skip a round trip for every file. GitHub Pages doesn't support custom headers.

After you deploy, check one file:

curl -sI https://your-site.pages.dev/_next/static/chunks/<file>.css | grep -i cache-control
Enter fullscreen mode Exit fullscreen mode

4. Check the share card on the live URL

Most deal traffic comes from a shared link, so the preview card is the first thing people see. In a static export, a generated app/opengraph-image.tsx is written as out/opengraph-image, with no file extension, and static hosts then serve it without a Content-Type. I ran into this on Cloudflare Pages and wrote it up here.

The simplest fix is to open the generated image in your browser, save it, and commit it as app/opengraph-image.png. Static files keep their extension. Then check the live URL:

curl -sI https://your-site.pages.dev/opengraph-image.png | grep -i content-type
Enter fullscreen mode Exit fullscreen mode

Before you post, paste the URL into a draft on each platform you plan to use and look at the preview.

5. Preload the hero image (Next.js 16 changed the prop)

If the hero image is the largest thing above the fold, it's your Largest Contentful Paint. Next.js 16 deprecated priority. The Image docs say to use preload for the same behavior, or loading="eager" if you only need to turn off lazy loading:

<Image
  src="/hero.png"
  alt="Dashboard showing this week's signups"
  width={1200}
  height={800}
  sizes="(min-width: 1024px) 50vw, 100vw"
  preload
/>
Enter fullscreen mode Exit fullscreen mode

Use preload on one image, the hero, not on every image.

Then measure the production build, not next dev:

npx next build && npx serve out
npx lighthouse http://localhost:3000 --only-categories=performance --view
Enter fullscreen mode Exit fullscreen mode

Lighthouse emulates a mid-range phone by default, which is closer to someone tapping your link in a chat app than your laptop is.

6. Crawl for placeholder links

Templates ship with href="#" links and example email addresses, and you stop seeing them after looking at your own page for a while. This is a crawl of my landing page template's demo:

$ node link-check.mjs http://localhost:4321
link-check: 1 page(s) crawled, 18 internal link target(s), 2 external link(s)
WARNING  [placeholder] Placeholder email mailto:hello@driftly.example.com   (on /)
WARNING  [placeholder] 13 placeholder link(s) with href="#" — point them somewhere real or remove them   (on /)
0 error(s), 2 warning(s)
Enter fullscreen mode Exit fullscreen mode

On a demo, that's expected. On your real launch page, each of those is a click that goes nowhere. If you don't have a crawler, a grep on the export finds the same things:

grep -rhoE 'href="#"|[a-z0-9.-]*example\.(com|org|net)' out --include=*.html | sort | uniq -c
Enter fullscreen mode Exit fullscreen mode
      4 driftly.example.com
     13 href="#"
Enter fullscreen mode Exit fullscreen mode

7. Make the banner end on time

In a static export, server code runs once, at build time. So this check is frozen into the HTML:

const dealIsOn = new Date() < new Date(deal.endsAt);
Enter fullscreen mode Exit fullscreen mode

If nobody deploys after the deal ends, the banner stays up and keeps advertising a code that no longer works. The checkoutUrl links from #1 keep the code for the same reason.

I use two fixes together. First, the banner hides itself in the browser once the end date has passed:

// src/components/deal-banner.tsx
"use client";

import { useSyncExternalStore } from "react";
import { deal } from "@/config/deal";

const endsAt = Date.parse(deal.endsAt);
const subscribe = () => () => {};

export function DealBanner() {
  // Server snapshot: shown in the prerendered HTML.
  // Client snapshot: hidden in the browser once the deal is over.
  const live = useSyncExternalStore(subscribe, () => Date.now() < endsAt, () => true);
  if (!live) return null;

  return (
    <div role="region" aria-label="Black Friday offer" className="bg-black px-4 py-2 text-center text-sm text-white">
      {deal.label} with code <strong>{deal.code}</strong>
    </div>
  );
}
Enter fullscreen mode Exit fullscreen mode
// in your page
{dealIsOn && <DealBanner />}
Enter fullscreen mode Exit fullscreen mode

useSyncExternalStore takes a separate snapshot for the server render. The prerendered HTML includes the banner, so nothing shifts while the deal runs, and the browser removes it after endsAt without a hydration error. I tested it with Playwright's clock set before and after the end date: shown, then gone, and no console errors either time.

Second, deploy again the day after the deal so the banner and the codes in the links leave the HTML too. Put that deploy on your calendar now, and give the code the same end date in your checkout dashboard.

The short version

  • Discount code pre-filled in every buy link, tested in test mode
  • UTM tags on every link you share, and a click event on the buy button
  • _headers with a one-year cache for /_next/static/*
  • Share image served with an image Content-Type on the live URL
  • Hero image uses preload, measured on the production build
  • No href="#" or example.com left
  • Banner hides itself after the end date, and a redeploy is on the calendar

My own deal

Disclosure: this checklist comes from two things I sell, and both are 40% off with code BF40 until Dec 1, 2026:

  • Next.js Launch Skills: 13 agent skills for Claude Code, Cursor and Codex that run most of these checks (SEO, share images, cache headers, Lighthouse, a link crawl) and fix what they find. $9.99 → $5.99. Open with the code applied
  • Liftoff: a Next.js 16 and Tailwind CSS landing page kit for SaaS products, with a guide to ship it in a day. $29 → $17.40. Open with the code applied

There's also a free, MIT-licensed edition with the pre-launch checklist and link crawler, OG images with a preview checker, and dark mode: npx skills add nandot12/nextjs-launch-skills · GitHub

What's on your pre-deal checklist that I missed?

Top comments (0)