Cloudflare edge Worker
Structured data at the edge
For sites behind Cloudflare that Aiptimise cannot reach through a store platform. A Cloudflare Worker on your zone adds Aiptimise's structured data to your pages as they are served, so AI crawlers, which do not run JavaScript, read it in the HTML.
What it does#
Aiptimise builds a JSON-LD document for each page it has something to say about: your services, offerings, products or organization, from your own published content. The Worker runs in front of your origin. When a page Aiptimise has a document for passes through, it appends one or more <script type="application/ld+json"> blocks just before </body>.
| The Worker | The Worker never |
|---|---|
Adds JSON-LD blocks before </body> on HTML pages Aiptimise has a document for. | Adds HTML, scripts, styles or anything a visitor can see. |
| Serves your page complete, whatever happens: a slow or failed answer from Aiptimise means the page goes out unchanged. | Caches, stores or changes your HTML. It caches only Aiptimise’s documents. |
| Records one log line per page request, so Aiptimise can count AI crawler visits. | Touches non-GET requests, static assets, other hostnames or paths Aiptimise excludes. |
When to use it#
- Your site is not on a platform Aiptimise connects to directly (such as a Shopify theme, or a Hydrogen storefront), and changing its code is slow or not possible.
- Your DNS is on Cloudflare and the site's hostnames are proxied (orange cloud). A Worker sees only proxied traffic. If your DNS is elsewhere, moving it is a bigger change than this install; talk to us first.
Nothing changes for your domain, hosting or deploys. The Worker runs on Cloudflare's Free plan as well as on paid plans.
What Aiptimise gives you#
- The Worker project: the script and a
wrangler.jsoncwith your values filled in. - Your site id, and the Worker name:
aiptimise-edge-followed by 12 characters, one per site. - The secret the Worker signs its requests with, shown once.
The install takes about 20 minutes for whoever runs your Cloudflare account. Start in
shadow mode: the Worker logs what it would do and changes nothing until you and Aiptimise both switch it on.