A PrestaShop module that acts as a middleware (proxy) between AI bots/crawlers and your shop: requests from known AI user agents (GPTBot, ClaudeBot, ChatGPT-User, PerplexityBot, …) receive the CiteCue AI-enhanced version of your pages and products, generated by the CiteCue app Auto-Fix pipeline. Regular visitors always get the normal PrestaShop pages.
AI crawler ──▶ PrestaShop front controller
│ actionDispatcherBefore (this module, earliest front-office hook)
│
├─ User-Agent matches the CiteCue crawler registry?
│ no ──▶ normal PrestaShop rendering
│ yes ──▶ GET {api}/api/delivery/v2/page?k=…&u=…&b=…
│ Authorization: Bearer ck_live_…
│ X-Citecue-Channel: prestashop
│ If-None-Match: <cached ETag>
│
│ 200 ──▶ serve enhanced HTML, stop
│ 304 ──▶ serve locally cached body, stop
│ 404 ──▶ not optimized: cache miss 60 s, normal rendering
│ timeout/error ──▶ fail open, normal rendering
- Serving + analytics in one call — the v2 delivery endpoint records the crawler hit (served/passthrough, channel, crawler id) server-side, so the Agent Traffic dashboard in CiteCue fills up with no extra beacon.
- ETag revalidation — enhanced bodies are cached locally; repeat crawler hits cost one cheap conditional request (a 304 still counts as served).
- Miss negative-cache (60 s) — pages without an enhanced version don't trigger an API call for every crawler request.
- Fail open, always — any API error, timeout or unexpected exception degrades to normal PrestaShop rendering. Human traffic never waits on the CiteCue API: the crawler-registry refresh only runs on requests that already matched a crawler.
- Crawler registry auto-refresh — a snapshot of the CiteCue crawler
registry ships with the module and is refreshed every 6 h from the keyless
GET /api/delivery/v1/crawlersfeed, so new crawlers are detected without a module update. /llms.txt— served fromGET /api/delivery/v2/llms.txt(to every visitor, cached 5 min), when enabled both in the module and for the project in the CiteCue dashboard.- No Host-header forwarding — the URL sent to the API is built from the
shop's configured domain, so a spoofed
Hostheader can't be replayed.
- Zip the module folder:
cd citecue-prestashop && zip -r citecue.zip citecue(or copycitecue/into your shop'smodules/directory). - In the back office: Modules → Module Manager → Upload a module.
- Open the module configuration:
- paste your organization API key (
ck_live_…) from the CiteCue dashboard (Settings → API keys); - the module auto-selects the CiteCue project matching your shop's domain (override the public key manually if needed);
- flip Serve enhanced pages to AI crawlers to Yes.
- paste your organization API key (
- In the CiteCue dashboard, register/approve pages on the Auto-Fix page and make sure delivery is enabled for the project.
The configuration page performs a live connection test on every load and tells you if the key is invalid, no project matches the shop domain, or delivery is switched off dashboard-side.
Verify from a shell:
curl -A "GPTBot" -sI https://your-shop.example/some-optimized-page/
# → X-Served-By: citecue-prestashop + X-Citecue-Mode on optimized pages
curl -s https://your-shop.example/llms.txt- PrestaShop 1.7.1+ (including 8.x / 9.x) — the
actionDispatcherBeforehook the module relies on was introduced in 1.7.1.0 - Outbound HTTPS from the shop server to the CiteCue API
(default
https://app.citecue.com; configurable for self-hosted instances) - PHP cURL extension recommended (a stream fallback is included)
citecue/
├── citecue.php # module: hooks, config page, serving logic
├── classes/
│ ├── CitecueClient.php # HTTP client for the Delivery API (v2 + v1 registry)
│ ├── CitecueCrawlers.php # bundled + auto-refreshed crawler UA registry
│ └── CitecueCache.php # file cache: ETag bodies + negative misses
└── logo.png
- The module sends
X-Citecue-Channel: prestashop. Until the CiteCue API addsprestashopto its channel enum, hits are bucketed under the fallback channel (wordpress) in the Agent Traffic channel split — everything else (crawler ids, served/passthrough) is exact. - Cached bodies live in
var/cache/…/citecue/(_PS_CACHE_DIR_) and are cleared on settings change and uninstall.