Skip to content

fix: strip referrer and tracking headers from gift card links - #896

Merged
Calebux merged 1 commit into
Calebux:mainfrom
JoyAdah:fix/strip-referrer-tracking-headers-848
Jun 23, 2026
Merged

fix: strip referrer and tracking headers from gift card links#896
Calebux merged 1 commit into
Calebux:mainfrom
JoyAdah:fix/strip-referrer-tracking-headers-848

Conversation

@JoyAdah

@JoyAdah JoyAdah commented Jun 23, 2026

Copy link
Copy Markdown

Summary

  • Added stripTrackingParams() utility to remove UTM, fbclid, gclid, ref, source, and campaign query params from all generated gift card URLs
  • Set Referrer-Policy: no-referrer header on all pages via next.config.mjs headers config
  • Changed openAtomicWalletGiftCard to use window.open(url, "_blank", "noreferrer,noopener") instead of window.location.href to prevent Referer header leakage
  • All outbound links to gift card providers (Atomic Wallet, etc.) now strip tracking params automatically
  • Added tests verifying tracking param removal for UTM, fbclid, gclid, ref, and source params

Closes #848

Test plan

  • Verify no Referer header is sent to gift card providers (check via browser DevTools Network tab)
  • Verify no UTM or tracking parameters appear in outbound URLs
  • Run npx vitest run client/lib/atomic-wallet.test.ts to verify new strip tests pass
  • Verify gift card purchase flow still works (button opens correct URL in new tab)

🤖 Generated with Claude Code

- Add stripTrackingParams utility to remove UTM, fbclid, gclid, ref,
  source, and campaign params from outbound gift card URLs
- Set Referrer-Policy: no-referrer header on all pages via next.config
- Change openAtomicWalletGiftCard to use window.open with
  noreferrer,noopener instead of window.location.href
- Add tests for tracking param stripping

Closes Calebux#848

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JoyAdah
JoyAdah requested a review from Calebux as a code owner June 23, 2026 21:10
@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

@JoyAdah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Calebux
Calebux merged commit 5c5fe74 into Calebux:main Jun 23, 2026
16 of 24 checks passed
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.

[P2] Tor: Strip referrer and tracking headers from all outbound gift card links

3 participants