Skip to main content
Episode 22 of 24Go live50 min

Add legal pages, search basics and trust signals

Add privacy, terms, returns, shipping, cookie and contact pages, plus sitemap, robots, page metadata, product structured data and analytics that wait for consent.

You will have: Draft policy pages linked from the footer and checkout, a consent banner that controls analytics, and the search basics (sitemap, robots, titles, descriptions, product data) in place, ready for a professional review.

Before you start

  • Episode 21 is done: your store is online and you can open a pull request that deploys a preview
  • Your real business details written down: legal business name, contact email, postal address if you have one, and your actual shipping times, return window and who pays return shipping
  • A decision on analytics: none for now, or a privacy-friendly tool you have chosen. Check the tool's free plan on its pricing page
  • Time to have the policies reviewed by a qualified person for your country before you take real orders. The drafts here are not legal advice

Make it yours

Change the example (fashion store) to your own. Your answers are saved in this browser and used in every episode.

Other series keywords (3)

Your prompt

Paste into: Your AI agent (Claude Code or Codex) opened in your project folder.
You are my web developer and careful content writer. My store "Thread & Needle" is a fashion e-commerce store at threadandneedle.com that sells women's and men's clothing, shoes and accessories to customers mainly in United States and charges in USD. Payments go through Stripe. I am not a programmer or a lawyer.

Important: you are not a lawyer. Write all policy pages as DRAFTS and say so at the top of each file. At the end, tell me clearly to have them reviewed by a qualified person for United States (and for any country I sell to) before I take real orders. Never invent facts: where a detail is missing (business name, address, return window, shipping times), ask me, or leave a visible placeholder like [YOUR RETURN WINDOW].

Plan first: show me your plan and wait for my OK before changing anything.

Tasks, on a new git branch:
1. Ask me for my real business details and policies, then draft these pages in plain language: Privacy Policy (what data we collect: account, orders, addresses, email; who processes it: the payment gateway, email service, hosting, image service, database; how long we keep it; how a customer asks for access or deletion), Terms of Sale, Returns and Refunds, Shipping, Cookie Notice, and a Contact page with a simple validated form that emails me through Resend (with spam protection and rate limiting) and shows my email address as a fallback.
2. Link all of them in the site footer, and add a required but unticked checkbox at checkout and sign-up: "I agree to the Terms and the Privacy Policy" with links. Store the time of agreement on the order.
3. Cookie and analytics consent: build a small banner with Accept and Reject buttons of equal prominence, and a link in the footer to change the choice later. Strictly necessary cookies (login, cart) work without consent. Any analytics script must load only after Accept. Ask me which analytics tool I want, or use none for now.
4. Search basics: add a sitemap listing the home page, categories, products and policy pages, and a robots file that allows public pages and blocks the admin, cart, checkout and account areas. Add a unique title and description and an Open Graph image to every public page, and mark private pages as noindex.
5. Product structured data: add JSON-LD of type Product on every product page with name, image, description, price, currency, and availability taken from real stock. Output it safely so no product text can break out of the script tag.
6. Trust signals: a clear footer with business name and contact details, secure checkout wording that does not claim anything untrue, visible shipping and returns summary on product pages, and no fake reviews, fake badges or invented counters.

Security rules: no secrets in code or logs; validate the contact form with Zod; escape all user text; do not store card data anywhere.

Verify yourself: run lint, the build and tests; fetch the sitemap and robots output and show them; show the JSON-LD for one product; prove that with consent rejected no analytics request or cookie is created, and that it loads after Accept.

Commit with a clear message such as "Add policy pages, consent banner, sitemap, robots and product structured data" and open a pull request.

Report back in this format:
- What was done
- What I should check (and a reminder to get the policies reviewed for United States)
- Anything that needs my decision

Review the prompt, then copy it. Never paste real passwords or API keys into a chat.

How to check it worked

  • The footer on every page links to Privacy, Terms, Returns, Shipping, Cookies and Contact
  • Each policy page starts with a visible draft notice and has no leftover square-bracket placeholders once you filled in your details
  • Opening /sitemap.xml lists your public pages and products, and /robots.txt blocks the admin, cart and checkout areas
  • A first-time visit shows the cookie banner, and after choosing Reject no analytics requests appear in the browser's Network tab
  • Google's Rich Results Test on a live product page recognizes a Product with price and availability
  • You arranged for a qualified person to review the policies for your country

Sample result

Example: fashion store

Example for the fashion store: consent banner, sitemap excerpt and product data. Wording and URLs will match your own store.

If something goes wrong

The agent writes confident legal wording or claims you comply with a specific law.
Reply: "Remove any claim of legal compliance. Keep plain descriptions of what we really do, mark the page as a draft, and list what a lawyer should check."
The banner shows on every page or analytics still loads after Reject.
Ask the agent to store the choice in a first-party cookie, read it before loading any script, and prove it with a test that rejects consent and checks no analytics request is sent.
The sitemap or Rich Results Test shows missing price or availability.
Open the product in the admin panel and check price, currency and stock are filled in. Then ask the agent to rerun the structured data test on that product page.
Private pages like the cart appear in search results.
Ask the agent to confirm those pages return noindex and are blocked in robots, then request removal in Google Search Console if they are already listed.

The pages and search setup are free. A professional policy review has a cost that depends on your country and provider. If you choose a paid analytics tool, verify its free plan on its pricing page.

More in Go live

This is part of the series Build a secure, no-cost e-commerce website with AI agents. See all 24 episodes, the tools used and answers to common questions on the series page.

We use optional cookies for analytics and referral tracking. Learn more about our privacy policy