Before you start
You need:- access to Measure > Crawler Analytics > Settings for the brand;
- PHP 7.4 or later with the cURL extension enabled;
- on WordPress, access to the active theme directory and
functions.php; - on another PHP site, access to the front controller, such as
index.php, or to the PHP configuration; - outbound HTTPS access from PHP to
https://www.qwairy.co; - a server-side secret facility or configuration excluded from source control.
Create and protect the key
- In Crawler Analytics settings, select WordPress.
- Select Create Key.
- Enter a descriptive name and the IANA time zone used for daily analytics.
- Copy the plaintext secret when it appears. Qwairy shows only its prefix later.
- Store it in server-side configuration. Do not commit it to the theme, expose it to JavaScript, place it in a URL, or write it to logs.
https://www.qwairy.co/api/v1/logs/ingest.
Add the generated tracker
Createqwairy-tracker.php with the current generated recipe. Place it in the active theme directory on WordPress, or next to your front controller on another PHP site:
- WordPress
- Other PHP sites
Add the setup snippet to If
functions.php:functions.php already starts with <?php, add only the two statements and do not insert a second opening tag.With a child theme, place qwairy-tracker.php in the child theme directory and replace get_template_directory() with get_stylesheet_directory(). get_template_directory() returns the parent theme directory, so the file would not be found.YOUR_API_KEY is a placeholder. Replace it only during deployment with the server-side value. If your host exposes secrets to PHP as environment variables, keep the value out of source code:
qwairy_init or qwairy_send_log.
Verify delivery
Use an uncached HTML page that returns200, and replace the example hostname. The tracker accepts GET, not HEAD. This synthetic request creates a crawler observation in the current analytic day:
- Confirm the request returns the expected page status.
- Confirm that PHP handled the request rather than a CDN or full-page cache.
- In Qwairy, wait for the connector to move from pending to connected after the accepted event reaches a daily rollup.
- Open the current analytic day and look for
/docs/qwairy-collector-check.
Limits and behavior
- The generated tracker reports only
GETrequests with a matching User-Agent. - Static file extensions and paths beginning with
/wp-admin/,/wp-json/,/api/, or/admin/are ignored. - A response with an explicit content type is reported only when it contains
text/html. - Delivery is a blocking cURL call during PHP shutdown with a five-second timeout. The generated tracker has no retry queue and does not inspect the Qwairy response.
- The integration route allows a burst of 120 ingestion requests per minute. Responses above that rate are not retried by the generated tracker.
- The endpoint applies hostname validation, Qwairy exclusions, maintained crawler classification, a 72-hour late-arrival window, and shared ingestion ceilings.
- The shared technical ceilings are 10,000,000 events per integration per day and 200,000,000 events per billed team per day.
- The collector observes requests. It does not prove indexing, model training, or citation use.
Rotate or roll back
To rotate the key, create a replacement in Qwairy, update the server-side value, confirm a new accepted observation, and then delete the previous key. To roll back the tracker:- Remove the
require_onceandqwairy_initcall fromfunctions.phpor from your front controller. - Deploy and clear the relevant application or host caches.
- Confirm the site still serves normally and no new tracker observations arrive.
- Remove
qwairy-tracker.phpand the server-side secret. - Revoke the corresponding Qwairy key.

