Add Organic AI referrer attribution#46182
Conversation
Detect AI/LLM referrers and classify them as an "Organic AI (AI)" source. Adds a REFERRER_DOMAINS_FOR_ORGANIC_AI list and branching logic to set attributionDetails.sourceChannelDetails and attributionDetails.campaign based on the referring AI platform (ChatGPT, Claude, Gemini, or Other) in website/api/helpers/salesforce/update-or-create-contact-and-account.js.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR tightens Bing organic search detection to match Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@website/api/helpers/salesforce/update-or-create-contact-and-account.js`:
- Around line 327-357: REFERRER_DOMAINS_FOR_ORGANIC_SEARCH is currently too
broad (e.g., 'https://www.bing.com/') so referrers for Bing Chat/Copilot (listed
in REFERRER_DOMAINS_FOR_ORGANIC_AI) are matched by referrer.startsWith(domain)
as Organic Search; update the search list to use more specific Bing search
prefixes such as 'https://www.bing.com/search' (and equivalent
'https://bing.com/search' variants) instead of the root host, or otherwise
narrow the matching pattern, so that referrers like 'https://www.bing.com/chat'
match REFERRER_DOMAINS_FOR_ORGANIC_AI; keep the existing
referrer.startsWith(domain) logic and the arrays
REFERRER_DOMAINS_FOR_ORGANIC_SEARCH and REFERRER_DOMAINS_FOR_ORGANIC_AI as the
locations to change.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6a41002c-26a3-41c5-ab3f-5f5fe1fb82ba
📒 Files selected for processing (1)
website/api/helpers/salesforce/update-or-create-contact-and-account.js
|
Actionable comments posted: 0 |
Accidentally submitted this review, will submit a new review momentarily
Detect AI/LLM referrers and classify them as an "Organic AI (AI)" source. Adds a REFERRER_DOMAINS_FOR_ORGANIC_AI list and branching logic to set attributionDetails.sourceChannelDetails and attributionDetails.campaign based on the referring AI platform (ChatGPT, Claude, Gemini, or Other) in website/api/helpers/salesforce/update-or-create-contact-and-account.js.
Related issue:
resolves fleetdm/confidential#16034
Summary by CodeRabbit