feat(website): a visitor's channel rides on into the bot link - #1179
Merged
Merged
Conversation
A visitor from a tagged link who presses "open in Telegram" reached the bot as nobody from nowhere. The visit's channel is remembered at arrival and put at the end of our bot's /start payload at the click (t27ai_bot only, never past Telegram's 64 characters, never over a channel already there), the way the bot reads it (999-multibots-telegraf splitStartSource). Contract: 16 checks; mutations (no 64 limit, any bot) are caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FJktaYxNrfAUdxSwdQw3gV
queen-fallback-parity is red on main: the lanes fallback said 0.86 while --hud-panel is declared 0.88. Ported here so this PR can go green; it no-ops once main carries the same line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FJktaYxNrfAUdxSwdQw3gV
Owner
Author
|
Red checks that are not caused by this PR:
Generated by Claude Code |
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.
What
Continues the channel counting of #1157. A visitor who arrives on t27.ai from a tagged link and then presses "open in Telegram" (
t.me/t27ai_bot?start=website,?start=foundry) used to reach the bot with no channel. The visit was counted, but nothing tied it to the bot start.The bot reads a channel at the end of its
/startpayload, after__(gHashTag/999-multibots-telegrafsplitStartSource). This change puts it there:trafficArrival.tsremembers the visit'sutm_sourcefor the session when the arrival is reported.carrySourceappends__<channel>to our bot's link. It applies only tot27ai_bot, never pushes the payload past Telegram's 64 characters, and never overwrites a channel already present.installBotLinkCarryappliescarrySourceat click time: a capturingclick/auxclickhandler that never blocks a click.On the bot side,
websiteis already one of our payloads (gHashTag/999-multibots-telegraf#3035), so these starts count with campaignwebsite.Checks
mainmerged in (51e64b5) after fix(website): repair blog merge fallout that blocked the site build #1180 fixed the type errors that blog: publish 'The token is mined, not sold' + 'A small agent needs an exact judge' #1173 left inblog/index.ts,Queen.tsxand a post body. Those errors are what tripped thechecksratchet on the first head; this PR does not touch those files.queen-fallback-parityis red onmaintoo:QueenLanes.cssgave--hud-panelthe fallback 0.86, but the token is declared as 0.88. The one-line fix is ported here (d29d4e0), so this PR can go green. It has no effect oncemaincarries the same line. Locally the check now passes 204/204 (203/204 before), andqueen-contraststill passes.tsc --stricton the module is clean.node_modules, so the hooks were bypassed for this commit.Work report
{ "version": 1, "head_sha": "d29d4e06ebb019209df2771dc3dfaef22501779a", "summary": "A visitor who arrives on t27.ai from a tagged link and presses open in Telegram now reaches the bot with the same channel at the end of the start payload, so the bot counts that start by channel.", "changes": [ "trafficArrival.ts remembers the visit's utm_source in the session when the arrival is reported.", "carrySource puts the channel after a double underscore at the end of the t27ai_bot start payload, only for our bot and within 64 characters.", "main.tsx installs a capturing click handler that tags our bot links at the moment they are pressed." ], "tests": [ { "command": "node --experimental-strip-types apps/website/qa/traffic-arrival-contract.mjs", "result": "The contract ran sixteen checks and all of them passed.", "status": "passed", "evidence": "Output: traffic-arrival contract: 16 checks passed" }, { "command": "Mutations: drop the 64 character limit, then allow any bot", "result": "Each mutation failed the contract on its own named check.", "status": "passed", "evidence": "never past 64 characters; never somebody else's bot" }, { "command": "tsc --noEmit --strict on src/lib/trafficArrival.ts", "result": "The module type-checks cleanly under strict mode.", "status": "passed", "evidence": "exit code 0 with no diagnostics printed" } ], "limitations": [ "Only the t27ai_bot links are tagged; other bots and channel links are left exactly as they were.", "The start is counted by the bot service, which must already carry the split of the channel from the payload." ], "tags": [ "analytics", "telegram", "website" ], "blog": { "title": "From a tagged visit to a counted bot start", "summary": "The site now hands the visitor's channel to the bot link at the moment of the click, so a reader who came from X and opened the bot is counted as an X start, closing the gap between a visit and a conversion.", "outline": [ "A visit and a bot start were counted separately, with nothing tying one to the other.", "The bot can only receive text through its start payload, so the channel rides at its end after a double underscore.", "Only our bot is tagged, never past Telegram's limit, and never over a channel already present." ] } }🤖 Generated with Claude Code
https://claude.ai/code/session_01FJktaYxNrfAUdxSwdQw3gV