Skip to content

Lead WhatsApp widget links through Hellotext's click endpoint - #102

Merged
rockwellll merged 1 commit into
mainfrom
whatsapp-widget-clicks
Nov 4, 2026
Merged

rockwellll merged 1 commit into
mainfrom
whatsapp-widget-clicks

Conversation

@rockwellll

@rockwellll rockwellll commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

What it does

  • Links through Hellotext. The server now renders the widget's launcher, teaser message and teaser buttons with links to /v1/public/widgets/whatsapp/:id/click?number=…&text=…. That endpoint records the click, adds the session's reference to the message and redirects to wa.me. The widget is cached once for every visitor, so its links can't carry the session. WhatsAppWidget rebuilds each link from the endpoint URL in data-hellotext--whatsapp-widget-click-url-value, keeping the rendered number and text (overrides included) and adding session. Links that don't lead to the endpoint are left alone. Without a session the links stay as rendered and still reach WhatsApp, with nothing recorded.
  • Views. The widget fetch sends session, so the server can count the visitor's view. The server leaves it out of its cache key, so visitors still share the cached widget.

Every click goes through the server; there's no browser-side dedupe. The server counts a session once a day in its unique clicks, and every click needs the server to add the reference.

Rebuilt lib and dist. docs/whatsapp.md now says the links go through Hellotext.

Tests

yarn test: 46 suites, 1142 tests pass. New tests cover the session on the widget fetch (and its absence) and the rebuilt links (session added, other links untouched, links kept without a session).

🤖 Generated with Claude Code

The widget's links now go to Hellotext's click endpoint, which records the
click, adds the session's reference to the prefilled message and redirects
to wa.me. The server caches one widget for every visitor, so the links it
renders can't carry the session. hellotext.js rebuilds each of them from the
endpoint URL the widget carries in
data-hellotext--whatsapp-widget-click-url-value, keeping the number and
message the widget rendered (overrides included) and adding the session.
Without a session the links stay as rendered and still reach WhatsApp.

The widget fetch also sends the session, so the visitor's view is counted.
The server leaves it out of its cache key.

Rebuilt lib and dist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T14:06:55.703565Z 8bd9ea2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@rockwellll
rockwellll merged commit 192e783 into main Nov 4, 2026
3 checks passed
@rockwellll
rockwellll deleted the whatsapp-widget-clicks branch November 4, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant