Developer: Guides
Integrations and data flows
The data flows LunaLift supports, from server-side and client-side tracking to CMS publishing, Google Search Console, Google Analytics, and context storage, how they reinforce each other, and how to set each one up.
Updated 2 October 2026
You can use LunaLift with no integrations at all. On its own it tracks how you show up in AI search, visibility, sentiment, and citations, audits your website, and drafts content strategies and articles, all from its own analysis. Integrations are optional, and each adds value: proving whether AI search actually sends you visitors and conversions, publishing on-brand content straight to your site, or grounding LunaLift's work in your own data and knowledge. This page shows what each adds, which integrations provide it, how hard each is to set up, and which to choose for your setup.
What each layer adds
| Layer | What you get |
|---|---|
| No integrations | Your AI-search visibility, sentiment and citations, a full website audit, and content strategy and drafting |
| Server-side tracking | See how AI search bots behave on your site, which engines read what and how often, to steer what you optimise next |
| Client-side tracking | See how AI search bots behave on your site, which engines read what and how often, to steer what you optimize next |
| Server-side and client-side together | Attribute real traffic and conversions to AI search, including the zero-click ones, so your optimization decisions drive real revenue growth |
| CMS | Ship the content and fixes you approve straight to your site, with no copy-paste |
| Search Console | Track your rich snippets, catch broken schema, and pull in the real search terms people use to reach you |
| Context (Notion) | Ground the content LunaLift drafts in your own product truth |
How the tracking works
Two kinds of tracking feed the analytics. Server-side tracking records which AI bots and other crawlers read your pages. Most crawlers never run JavaScript, so browser-based tracking, like Google Analytics or any other in-browser method, does not see them; server-side tracking does, because it runs on the request itself. On each page request your server sends LunaLift a headers-only ping, just the URL, user agent, and IP, never the page content. LunaLift uses it only to identify the crawler, matching the IP against known bot addresses; it does not store a human visitor's IP. Client-side tracking is a small browser pixel that records page views from real people.
Most AI-search referrals are zero-click: the AI answers in place and the person reaches you without clicking a link from it, so there is no click for ordinary analytics to trace back to AI. These are your indirect referrals, the AI-driven visits ordinary analytics miss entirely. Surfacing them is the reason to run server-side and client-side tracking together, since neither can do it alone: when a crawler reads a page and real visits follow shortly after, LunaLift infers the AI-driven share against that page's normal traffic and credits the conversions on those visits. The smaller share that arrive by a direct click out of an AI answer, the pixel identifies on its own.
Bots: server-side tracking
This captures AI bot traffic, which engines and other bots crawl you and how often, and, together with client-side tracking, powers the zero-click indirect AI-referral inference. It runs on your server or edge and fires a headers-only ping to LunaLift on each request. Use exactly one method: running two makes each fire its own ping and double-counts your crawler traffic. The Shopify app and the WordPress plugin do this server-side tracking too, bundled with their CMS connection (see the CMS section below).
| Option | Difficulty | Covers | Setup |
|---|---|---|---|
| Cloudflare Worker | Easy | Bots Humans Schema | On LunaLift's Integrations page, follow the Cloudflare wizard to deploy the worker |
| Your own server | Medium | Bots Humans Schema | In your own server or app code, on each request |
| Shopify app | Easy | Bots Humans Schema Publishing | On LunaLift's Integrations page, Shopify toggle, then install the app in Shopify |
| WordPress plugin | Medium | Bots Humans Schema Publishing | Upload the LunaLift plugin in WordPress (Plugins, Add New, Upload Plugin), Activate, then Connect from the LunaLift menu |
Cloudflare Worker
On LunaLift's Integrations page, open the Cloudflare card and click Configure. The wizard walks you through setup per domain and generates the exact routes for you. The steps it gives are to clone the public worker template at github.com/lunalift/cloudflare-worker-template, add those routes to its wrangler.toml, and run npx wrangler deploy. Your domain's zone must already be on Cloudflare (proxied, the orange cloud) for the routes to match, and the worker does not change your DNS nameservers. The wizard can also give you a ready-made prompt, with the full setup instructions, to paste into the coding agent of your choice.
Your own server (any language)
If you are not on Cloudflare, run the tracking from your own application. On each HTML request, send a headers-only POST to the bot-check endpoint. The same public worker template repo includes middleware examples for Next.js (middleware.ts) and SvelteKit (hooks.server.ts), and a shared helper (buildBotCheckPayload) that builds the headers for you in JavaScript or TypeScript; in any other language, set the four headers yourself. This layer also injects the pixel for the human side, and it can inject your schema and serve your Markdown mirrors just like the Worker.
POST https://optimize.lunalift.ai/bot-check
X-Page-URL: the full URL that was requested
X-Forwarded-For: the visitor IP
X-Original-User-Agent: the caller's user agent
X-Original-Referer: the referer, if anySend it fire-and-forget: classification is server-side and must not block your response.
Humans: client-side tracking and conversions
A small browser pixel records the visits real people make to your pages. Combined with server-side tracking it reveals the zero-click AI referrals, and once you tag your conversion events, the AI-driven visits get attributed conversions too. The Cloudflare Worker, the Shopify app, and the WordPress plugin add the pixel for you automatically, and the Webflow and Sanity integrations add it too (see the CMS section below). Otherwise you inject it yourself, from your own middleware or through a tag manager like Google Tag Manager.
| Option | Difficulty | Covers | Setup |
|---|---|---|---|
| Tracking pixel | Easy | Humans Conversions | Auto-added by the Worker or Shopify app; otherwise add it to your pages via middleware or a tag manager |
| Google Analytics | Easiest | Humans | On LunaLift's Integrations page, GA4 toggle, then authorize with Google and pick your property |
The tracking pixel
The tracking pixel is a small piece of JavaScript on your pages that records the visits real people make, the client-side half of AI-traffic tracking. The Cloudflare Worker, the Shopify app, and the WordPress plugin add it for you automatically, and the Webflow and Sanity integrations add it too (see the CMS section below). Otherwise, inject it yourself, from your own middleware or through a tag manager like Google Tag Manager, placing this script before the closing body tag:
<script src="https://optimize.lunalift.ai/pixel.js"></script>Conversions come from events you tag on your pages. Define them in the Webpage Analytics table using the tag icon, and the pixel attributes the ones AI traffic drove. The Analytics hub guide walks through tagging.
Google Analytics
Google Analytics is the easy fallback. In your LunaLift account, open the Integrations page and click the Google Analytics toggle; LunaLift sends you to Google for read-only access, then you pick your GA4 property, with nothing to change on your site. It brings your human user traffic and the AI referrals Google already attributes, but it cannot see AI crawlers, cannot infer the zero-click AI referrals, and any conversions you track in GA4 stay in GA4. Use it when you cannot or would rather not add the pixel and server-side tracking; when you can, those give the complete picture.
CMS: publishing and schema
A CMS connection lets LunaLift push finished articles straight to your CMS, with their Schema.org markup (the structured data search engines and AI read) already filled in. It only ever pushes what you have approved, so you stay in control of what goes live. You connect one from LunaLift's Integrations page. WordPress, Webflow, Shopify, and Sanity each do this. That markup can also be added without a CMS, by the Cloudflare Worker or your own server, both covered in the Bots section above.
| Option | Difficulty | Covers | Setup |
|---|---|---|---|
| Shopify | Easy | Publishing Schema Bots Humans | On LunaLift's Integrations page, Shopify toggle, then install the app in Shopify |
| Webflow | Easy | Publishing Schema Humans | On LunaLift's Integrations page, Webflow toggle, then authorize in Webflow |
| WordPress | Medium | Publishing Schema Bots Humans | Upload the LunaLift plugin in WordPress (Plugins, Add New, Upload Plugin), Activate, then Connect from the LunaLift menu |
| Sanity | Medium | Publishing Schema Humans Bots | On LunaLift's Integrations page, Sanity toggle, then enter project ID, dataset, write token |
Shopify
In your LunaLift account, open the Integrations page and click the Shopify toggle. In the setup that opens, enter your shop domain; LunaLift then sends you to Shopify to install its app and approve the permissions it asks for. Once you approve, Shopify returns you to LunaLift and the store is connected. From then on the app's proxy injects your Schema.org markup and the tracking pixel and fires the server-side bot-check, so this one connection covers publishing, tracking, and schema. Because it already does the tracking, do not also run the Cloudflare Worker on a Shopify store.
Webflow
In your LunaLift account, open the Integrations page and click the Webflow toggle. LunaLift sends you to Webflow to authorize access to your sites and CMS. Once you approve, it returns you to LunaLift and publishing is ready: LunaLift pushes the articles you approve into your Webflow CMS with their Schema.org markup filled in.
Tracking on Webflow is optional and set up separately in the card. Re-publish installs the LunaLift pixel for human visits and AI-attributed conversions. For bot tracking, copy the beacon snippet LunaLift shows you and paste it into Webflow under Site Settings, then Custom code, then Footer code (see Webflow's own guide); it catches image-fetching crawlers like Perplexity. For full AI-bot tracking that includes ChatGPT and Claude, use the Cloudflare integration instead.
WordPress
WordPress connects from its own side, not with a toggle in LunaLift. The plugin is not on the public WordPress.org directory, so you install it by hand. First, in your LunaLift account, open the Integrations page and get the plugin from the WordPress card. Then, in your WordPress admin, go to Plugins, then Add New, then Upload Plugin, upload the file, and Activate. The plugin adds a LunaLift menu to your WordPress admin sidebar: open it and click Connect, which signs you in to LunaLift and links the site to your company. Finally, back in your LunaLift account on the Integrations page, click Test integration on the WordPress card to confirm the link is live. From then on the plugin does the whole job on your site, just like the Shopify app: it publishes the articles you approve with their Schema.org (JSON-LD) markup, injects the tracking pixel, and fires the server-side bot-check. One plugin covers publishing, schema, and both kinds of tracking, so do not also run the Cloudflare Worker on a WordPress site.
Sanity
In your LunaLift account, open the Integrations page and click the Sanity toggle. In the setup that opens, enter your Sanity project ID, your dataset (production by default), and a write token. LunaLift then pushes the articles you approve into your Sanity Studio. Because Sanity is headless, your own frontend renders the content, so schema and tracking are not automatic: the integration gives you a render-time helper that your app calls to inject the Schema.org markup and the pixel and to fire the bot-check. Wire that helper in, or handle tracking with the Cloudflare Worker or your own server instead.
Company data and knowledge
These are read-only sources LunaLift connects to and reads, to ground its work and track your search presence. You connect them from LunaLift's Integrations page too.
| Option | Difficulty | Covers | Setup |
|---|---|---|---|
| Google Search Console | Easy | Search | On LunaLift's Integrations page, GSC toggle, then authorize with Google and pick your property |
| Notion | Easy | Context | On LunaLift's Integrations page, Notion toggle, then authorize and choose pages |
Google Search Console
In your LunaLift account, open the Integrations page and click the Google Search Console toggle. LunaLift sends you to Google to grant read-only access; once you approve, pick the Search Console property for your site. It then tracks your rich snippets, flags broken or missing Schema.org markup, and pulls in the real keywords and queries people search to reach your site, which feeds prompt discovery.
Notion
In your LunaLift account, open the Integrations page and click the Notion toggle. LunaLift sends you to Notion to authorize access and choose which pages to share; once you approve, it reads those pages on demand to ground its content in your real business. Google Drive is coming soon.
Two common setups
Two examples, to show how the pieces fit together:
Your own site, behind Cloudflare
Say your site's DNS runs through Cloudflare and you publish through a CMS like WordPress or Webflow. Three connections cover you: the Cloudflare Worker for tracking and schema (you can deploy it because Cloudflare already fronts your site), your CMS for publishing, and Google Search Console for search data. If your site is not fronted by Cloudflare, do the same from your own app instead, with framework middleware or server code that handles the server-side tracking and injects the pixel and schema.
A Shopify store
Say you sell on Shopify, do not run your own servers or DNS, and would rather not touch code, but you still want AI-search tracking and to publish AI-optimized articles. Here the Shopify app is the whole answer: one connection covers bot and visitor tracking, schema, and publishing. If you also want an easy read on your human user traffic, connect Google Analytics. Do not add the Cloudflare Worker as well: the app already does the tracking, and two trackers double-count.
What not to combine
- One server-side tracker only. The Cloudflare Worker, an own-server integration, the Shopify app, and the WordPress plugin each fire their own bot-check, so running two double-counts your crawler traffic.
- The Cloudflare Worker does not work on a Shopify store. Shopify already routes its storefront through its own Cloudflare, so you cannot put your own Worker in front of it; use the Shopify app, which does the tracking.
- On WordPress, the plugin already does the tracking, so there is no need to also run a Cloudflare Worker, and running both would double-count.
- One pixel only. The Cloudflare Worker, the Shopify app, the WordPress plugin, and Webflow add the pixel for you, and skip it when it is already present, so do not also paste it by hand where one of them is already running.
Optional: pull your data into your own tools
Everything these integrations capture already shows up in your LunaLift dashboards. If you would rather have it in your own dashboards, warehouse, or scripts, it is also available through the REST API: read Get your AI-traffic data out via the API, with the exact request and response shapes in the API reference.
