fix(affiliates): resolve visitorId always-undefined bug with cookie-based deduplication#103
Open
Danieliushka wants to merge 2 commits intoprofullstack:masterfrom
Open
fix(affiliates): resolve visitorId always-undefined bug with cookie-based deduplication#103Danieliushka wants to merge 2 commits intoprofullstack:masterfrom
Danieliushka wants to merge 2 commits intoprofullstack:masterfrom
Conversation
Users were sharing dashboard URLs (which 404) instead of public links. Adds a small CopyLinkButton component (link icon → green check on copy) to GigCard, AgentCard, MCP listing cards, and Prompt listing cards so the correct public URL is one click away. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ased deduplication - Read ugig_visitor cookie from incoming request; generate a UUID if absent - Pass visitorId to recordClick() instead of hardcoded undefined - Set ugig_visitor cookie (1 year) on the redirect response for new visitors - Add 24h deduplication in recordClick(): same visitorId + trackingCode within 24 hours is treated as a single click and not double-counted - IP-hash rate-limit is now a fallback used only when visitorId is unavailable Fixes profullstack#96 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
visitorIdwas hardcoded asundefinedin affiliate click trackingugig_visitorcookie, 1yr TTL)Changes
src/app/api/affiliates/click/route.ts: Read/generate visitor ID from cookie, pass torecordClick()src/lib/affiliates/tracking.ts: Added 24h dedup query before inserting clickTest plan
ugig_visitorcookie is set🤖 Generated with Claude Code