Skip to content

docs: explain how to track clicks on HSM Dynamic URL buttons#642

Open
SangeetaMishr wants to merge 3 commits into
mainfrom
docs/hsm-dynamic-url-click-tracking
Open

docs: explain how to track clicks on HSM Dynamic URL buttons#642
SangeetaMishr wants to merge 3 commits into
mainfrom
docs/hsm-dynamic-url-click-tracking

Conversation

@SangeetaMishr

@SangeetaMishr SangeetaMishr commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #265

Adds a "Tracking clicks on a URL button" section right after the Dynamic URL example in the HSM Templates doc, explaining:

  • Why Glific can't show click counts for Static/Dynamic URL buttons: WhatsApp never sends an event back to Glific when a contact taps a URL button (unlike Quick Reply buttons, whose taps come back as a message).
  • The workaround: embed a unique per-contact value in the Dynamic URL and route it through a redirect/link-tracking service that logs the click before forwarding the contact to the real destination.
  • A pointer to use Quick Reply buttons instead, if the flow itself needs to branch on whether the contact engaged.

Verification

Confirmed against glific/glific:

  • lib/glific_web/providers/gupshup/router.ex only routes an inbound button_reply (Quick Reply) webhook to the message controller — there is no equivalent inbound route/handler for CTA/URL button taps, so Glific never learns a URL button was tapped.
  • This matches the existing caveat already in this same doc file ("clicks on this button won't be recorded, as the link opens outside and does not send a response back to the flow"), which this PR generalizes into concrete guidance.

Test plan

  • Docs site renders the new section and :::note admonition correctly
  • Reviewer confirms this matches what's told to orgs on Discord/support

Summary by CodeRabbit

  • Documentation
    • Updated the HSM Templates documentation date.
    • Added guidance for tracking URL button clicks using dynamic URLs and redirect layers.
    • Clarified that WhatsApp does not report URL button taps and recommended Quick Reply buttons when engagement-based responses are needed.

WhatsApp doesn't send Glific any event when a contact taps a URL
button, so there's no built-in click count. Document the workaround:
route the Dynamic URL through a per-contact tracking/redirect link,
and use Quick Reply buttons instead when the flow itself needs to
react to the tap.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated the HSM Templates documentation’s last-updated date to July 2026. Added guidance explaining that WhatsApp does not report URL button taps to Glific, recommending dynamic URLs with tracking or redirect layers, describing unique-value matching for recorded clicks, and suggesting Quick Reply buttons when engagement must trigger flow logic.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main doc change about tracking HSM dynamic URL clicks.
Description check ✅ Passed The description matches the documentation update and explains the tracking limitation and workaround.
Linked Issues check ✅ Passed The PR addresses #265 by documenting the click-tracking limitation and the redirect/link-tracking workaround.
Out of Scope Changes check ✅ Passed The metadata and formatting edits are minor and aligned with the stated documentation update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 4, 2026 07:51 Inactive
Bump Last Updated to July 2026, drop the bold heading and note
admonition on the new section in favor of plain prose matching the
rest of the page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pull request July 4, 2026 07:57 Inactive
@SangeetaMishr
SangeetaMishr requested a review from Fawas003 July 4, 2026 07:57
@SangeetaMishr SangeetaMishr self-assigned this Jul 5, 2026
@SangeetaMishr

Copy link
Copy Markdown
Contributor Author

@Fawas003 Can you please review this.

@github-actions
github-actions Bot temporarily deployed to pull request July 15, 2026 03:07 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/4`. Product Features/06.  HSM Templates.md:
- Line 150: Update the documentation sentence about matching recorded clicks to
contacts so it says “clicked” rather than “opened,” specifically describing
which contacts clicked the link without implying the destination page was opened
or consumed.
- Around line 148-149: Update the tracking-link guidance near the dynamic URL
example to recommend an opaque random or signed token mapped server-side instead
of a raw contact ID. Explicitly caution against placing contact identifiers or
other PII in URLs, while preserving the redirect and click-tracking workflow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4ef50f69-e20d-4839-a00d-cbf1d740449c

📥 Commits

Reviewing files that changed from the base of the PR and between 9be314b and aee729f.

📒 Files selected for processing (1)
  • docs/4. Product Features/06. HSM Templates.md

Comment on lines +148 to +149
- Use a Dynamic URL to add a unique value for each contact to the link, for example the contact's ID: `https://yourdomain.org/track/{{1}}`
- Point this link to a redirect page you control, or a link-tracking tool (such as Bitly or Rebrandly), that records every click along with that unique value before sending the contact on to your real destination page.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Avoid putting a raw contact ID in the tracking URL.

This can expose a stable user identifier in browser history, request logs, and third-party tracking analytics. Recommend an opaque, random or signed token mapped server-side, and explicitly caution against including PII in the URL.

Proposed wording
-- Use a Dynamic URL to add a unique value for each contact to the link, for example the contact's ID: `https://yourdomain.org/track/{{1}}`
+- Use a Dynamic URL with an opaque, non-PII token mapped to the contact server-side: `https://yourdomain.org/track/{{1}}`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Use a Dynamic URL to add a unique value for each contact to the link, for example the contact's ID: `https://yourdomain.org/track/{{1}}`
- Point this link to a redirect page you control, or a link-tracking tool (such as Bitly or Rebrandly), that records every click along with that unique value before sending the contact on to your real destination page.
- Use a Dynamic URL with an opaque, non-PII token mapped to the contact server-side: `https://yourdomain.org/track/{{1}}`
- Point this link to a redirect page you control, or a link-tracking tool (such as Bitly or Rebrandly), that records every click along with that unique value before sending the contact on to your real destination page.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/4`. Product Features/06.  HSM Templates.md around lines 148 - 149,
Update the tracking-link guidance near the dynamic URL example to recommend an
opaque random or signed token mapped server-side instead of a raw contact ID.
Explicitly caution against placing contact identifiers or other PII in URLs,
while preserving the redirect and click-tracking workflow.


- Use a Dynamic URL to add a unique value for each contact to the link, for example the contact's ID: `https://yourdomain.org/track/{{1}}`
- Point this link to a redirect page you control, or a link-tracking tool (such as Bitly or Rebrandly), that records every click along with that unique value before sending the contact on to your real destination page.
- Match the recorded clicks back to your contacts using the unique value, to see who opened the link.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Say “clicked,” not “opened.”

A redirect records a click/request; it does not prove that the destination page was opened or consumed. Change this to “see which contacts clicked the link.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/4`. Product Features/06.  HSM Templates.md at line 150, Update the
documentation sentence about matching recorded clicks to contacts so it says
“clicked” rather than “opened,” specifically describing which contacts clicked
the link without implying the destination page was opened or consumed.

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.

Track users who clicked the HSM dynamic link

2 participants