feat: count visits AI products send (AI referrals) - #99
Merged
Merged
Conversation
When connected to WebDecoy Cloud, the plugin counts page visits whose Referer (or campaign tags) names an AI product, by platform and landing path, in a small table (DB 2.3.0), and sends the counts every fifteen minutes to /api/v1/sdk/ai-referrals as source wordpress. A send claims the open counts under a batch id; a failed send is retried with the same id, which WebDecoy counts once. Nothing about a visitor is stored or sent. The platform table and the golden vectors the PHP classifier replays are generated from WebDecoy's own classifier (WebDecoy/app#1321). Only a GET document navigation counts; pages served from a full-page cache never reach PHP, so the figure is a floor. Disclosed under External Services; the webdecoy_count_ai_referrals filter turns it off. Uninstall drops the table.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to WebDecoy/app#1324 / #1325 (issue app#1321).
WebDecoy\\LlmReferral: PHP port of the app's classifier over a generated table (sdk/src/registry/llm-platforms.generated.php);tests/LlmReferralTest.phpreplays all 79 generated vectors. Reads repeated query keys like browsers do (notparse_str).WebDecoy_AI_Referrals: ontemplate_redirect, counts GET document navigations (Sec-Fetch-Mode: navigate) from an AI product into{prefix}webdecoy_ai_referrals(ref_key= sha1(platform+path) keeps the key within older MySQL index limits; bounded at 5000 rows). Cron every 15 min claims open rows under a batch id and sends{report_id, source: 'wordpress', referrals}; failure keeps the id for retry (server dedupes); 4xx drops the batch.detections:write);webdecoy_count_ai_referralsfilter disables it.Tests:
php tests/run.php181 passed; phpcs clean on changed files. Full-page caches mean the count is a floor.Release after the ingest endpoint is deployed (version bump PR then
bin/release-all.sh).