Skip to content

Populate referrer fields from marketing cookie#45807

Merged
johnjeremiah merged 1 commit into
mainfrom
jj-save-referrer-data-to-sfdc
May 22, 2026
Merged

Populate referrer fields from marketing cookie#45807
johnjeremiah merged 1 commit into
mainfrom
jj-save-referrer-data-to-sfdc

Conversation

@johnjeremiah
Copy link
Copy Markdown
Contributor

@johnjeremiah johnjeremiah commented May 19, 2026

Set Salesforce contact referrer fields from marketingAttributionCookie.referrer. Adds Source_referrer_url__c and Most_recent_referrer_url__c assignments in the initial attribution block and an additional Most_recent_referrer_url__c assignment in the later block so referrer data is persisted when creating/updating contacts.

Summary by CodeRabbit

  • New Features
    • Enhanced Salesforce integration with improved contact attribution tracking. Referrer information is now automatically captured and stored in designated attribution fields for both newly created and updated contact records, enabling more comprehensive tracking of customer acquisition sources and marketing engagement paths throughout the user journey.

Review Change Stack

Set Salesforce contact referrer fields from marketingAttributionCookie.referrer. Adds Source_referrer_url__c and Most_recent_referrer_url__c assignments in the initial attribution block and an additional Most_recent_referrer_url__c assignment in the later block so referrer data is persisted when creating/updating contacts.
@johnjeremiah johnjeremiah marked this pull request as ready for review May 19, 2026 21:04
@fleet-release fleet-release requested a review from eashaw May 19, 2026 21:04
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

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.

@johnjeremiah johnjeremiah marked this pull request as draft May 19, 2026 21:04
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4ed7949a-f804-4ba6-be77-d3e86e9041bd

📥 Commits

Reviewing files that changed from the base of the PR and between 4ed988f and 4133dae.

📒 Files selected for processing (1)
  • website/api/helpers/salesforce/update-or-create-contact-and-account.js

Walkthrough

This PR modifies the Salesforce Contact synchronization helper to populate additional attribution fields from the marketing cookie referrer. When creating a new Contact, it writes the referrer URL to both Source_referrer_url__c and Most_recent_referrer_url__c. When updating an existing Contact (after a duplicate-detected create attempt), it sets Most_recent_referrer_url__c to the referrer value while preserving the existing campaign/source deletion logic.

Possibly related PRs

  • fleetdm/fleet#45427: Also modifies the same Salesforce Contact helper file, changing attribution fields (Most_recent_campaign_member_status__c) based on contact source values.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks required checklist items from the repository template; no checkboxes are marked and critical sections like testing, database migrations, and configuration are not addressed. Complete the PR template checklist by selecting applicable items and providing details on testing, security validation, and any database/configuration changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: populating Salesforce referrer fields from the marketing attribution cookie.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jj-save-referrer-data-to-sfdc

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 and usage tips.

@johnjeremiah
Copy link
Copy Markdown
Contributor Author

Just confirmed the fields on the contact are ready:
Source_referrer_url__c
Most_recent_referrer_url__c

@johnjeremiah johnjeremiah marked this pull request as ready for review May 20, 2026 19:35
@johnjeremiah johnjeremiah self-assigned this May 21, 2026
@johnjeremiah
Copy link
Copy Markdown
Contributor Author

@eashaw I think this PR is ready to go

@johnjeremiah johnjeremiah merged commit 04e0bef into main May 22, 2026
13 checks passed
@johnjeremiah johnjeremiah deleted the jj-save-referrer-data-to-sfdc branch May 22, 2026 12:18
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.

2 participants