Website: Update attribution cookie (#40532)

Closes: https://github.com/fleetdm/confidential/issues/14391

Changes:
- Updated the attribution cookie set in the website's custom hook to
include the value of a user's `gclid` query parameter (if it is set)
- Updated the updateOrCreateContactAndAccount helper to set this value
on created Contact records.
This commit is contained in:
Eric 2026-02-25 15:18:14 -06:00 committed by GitHub
parent 8c22ad0284
commit 0693041f13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -178,6 +178,8 @@ module.exports = {
em: 'Email marketing (EM)',
};
attributionDetails.gclid = marketingAttributionCookie.gclid;
attributionDetails.sourceChannelDetails = sourceFriendlyNameByCodeName[lowerCaseMediumValue] ? sourceFriendlyNameByCodeName[lowerCaseMediumValue] : undefined;
attributionDetails.initialUrl = marketingAttributionCookie.initialUrl;
@ -391,6 +393,7 @@ module.exports = {
valuesToSet.Most_recent_channel__c = attributionDetails.sourceChannel;// eslint-disable-line camelcase
valuesToSet.Most_recent_campaign__c = attributionDetails.campaign;// eslint-disable-line camelcase
valuesToSet.Most_recent_campaign_initial_url__c = attributionDetails.initialUrl;// eslint-disable-line camelcase
valuesToSet.GCLID__c = attributionDetails.gclid;// eslint-disable-line camelcase
}

View file

@ -203,6 +203,7 @@ will be disabled and/or hidden in the UI.
source: req.param('utm_source'),// will be undefined if this is not set
medium: req.param('utm_medium'),// will be undefined if this is not set
campaign: req.param('utm_campaign'),// will be undefined if this is not set
gclid: req.param('gclid'),// will be undefined if this is not set
referrer: req.get('referer'),
initialUrl: req.url,
};