Why Add UCP to Squarespace?
Squarespace is known for beautiful, design-forward websites. Adding UCP support extends your stunning store to AI shopping agents, allowing ChatGPT, Google AI, and other AI assistants to discover and recommend your products.
- Design Excellence: Your beautiful products deserve AI visibility
- Code Injection: Add custom functionality without compromising design
- Built-in Commerce: Squarespace Commerce integrates seamlessly
- SEO Focus: Already optimized, now AI-optimized too
/.well-known/ directly. We'll use a workaround with external hosting and a custom page approach.
Implementation Methods
| Method | Difficulty | Requirements |
|---|---|---|
| External Hosting + Redirect | Easy | Custom domain, external host |
| Code Injection Page | Medium | Business plan or higher |
| Cloudflare Worker | Medium | Cloudflare DNS |
Method 1: External Hosting (Recommended)
Host your UCP profile externally and redirect requests to it.
Generate Your UCP Profile
Create a customized UCP profile for your Squarespace store.
Open Generator โUpload your UCP JSON file to one of these free services:
Option A: GitHub Gist (Free)
- Go to gist.github.com
- Create a new gist with your UCP JSON
- Click "Raw" to get the direct URL
Option B: JSONBin (Free)
- Go to jsonbin.io
- Create an account and paste your JSON
- Get the public access URL
Option C: Vercel (Free)
# Create a simple project mkdir ucp-profile && cd ucp-profile echo '{}' > vercel.json # Create public/.well-known/ucp file with your JSON mkdir -p public/.well-known # Copy your ucp.json content to public/.well-known/ucp # Deploy vercel --prod
If you're using Cloudflare or another DNS provider that supports Page Rules or Workers:
Cloudflare Worker Example
addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)) }) async function handleRequest(request) { const url = new URL(request.url) // Intercept .well-known/ucp requests if (url.pathname === '/.well-known/ucp') { // Fetch from your hosted profile const ucpUrl = 'https://your-profile-host.com/ucp.json' const response = await fetch(ucpUrl) const json = await response.text() return new Response(json, { headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*', 'Cache-Control': 'public, max-age=3600' } }) } // Pass through to Squarespace for all other requests return fetch(request) }
Method 2: Code Injection Page
Create a dedicated page that serves your UCP profile (alternative endpoint).
- In Squarespace, go to Pages โ + โ Blank Page
- Name it "UCP Profile" or similar
- Set the URL slug to
ucp-profile
- Add a Code Block to the page
- Set display to HTML
- Paste your UCP JSON wrapped in a pre tag:
<pre id="ucp-profile" style="display:none;"> { "profile_version": "1.0", "merchant": { "name": "Your Store Name", "url": "https://yourstore.com" } } </pre> <script> // Redirect to show raw JSON const pre = document.getElementById('ucp-profile'); const json = pre.textContent; document.body.innerHTML = '<pre>' + json + '</pre>'; </script>
- Go to Pages
- Drag the UCP Profile page to Not Linked section
/ucp-profile, not the standard /.well-known/ucp. You'll need to specify this URL when validating or registering your store.
Schema.org Markup
Squarespace automatically adds basic Schema.org markup for products. To enhance it, use Code Injection:
- Go to Settings โ Advanced โ Code Injection
- Add structured data in the Header section:
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Organization", "name": "Your Store Name", "url": "https://yourstore.com", "sameAs": [ "https://instagram.com/yourstore", "https://twitter.com/yourstore" ] } </script>
Validate Your Implementation
Validate Your Squarespace Store
Check your UCP implementation and AI commerce readiness.
Run Validation โCommon Issues & Solutions
| Issue | Solution |
|---|---|
Can't create /.well-known/ |
Use external hosting with Cloudflare Worker or DNS redirect |
| Page shows Squarespace template | Use Code Block with script to replace body content |
| CORS errors | Ensure external host sets Access-Control-Allow-Origin |
| Code injection not working | Ensure you have Business plan or higher |
๐ค Test with AI Agents
Run AI Agent Simulation
Test how AI shopping agents will interact with your Squarespace store.
Open Simulator โ