-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
function getCookieValue(name) { | ||
const match = document.cookie.match('(^|;) *' + name + '=([^;]*)'); | ||
if (match) { | ||
return match[2] | ||
} | ||
return false; | ||
const match = document.cookie.match('(^|;) *' + name + '=([^;]*)'); | ||
if (match) { | ||
return match[2]; | ||
} | ||
return false; | ||
} | ||
|
||
export default function communityOutreach() { | ||
if (document.referrer.includes('/redirects/communityoutreach/')) { | ||
document.cookie = 'communityoutreach=true'; | ||
if (document.referrer.includes('/redirects/communityoutreach/')) { | ||
document.cookie = 'communityoutreach=true'; | ||
} | ||
window.addEventListener('DOMContentLoaded', function () { | ||
const outreachCampaignUser = getCookieValue('communityoutreach'); | ||
if (window.location.pathname == '/file-a-complaint/' && outreachCampaignUser) { | ||
const faCLink = document.querySelector('.civil-rights-complaint'); | ||
faCLink.setAttribute( | ||
'href', | ||
'https://civilrights.justice.gov/report?utm_campaign=61607827-e620-4e59-8850-b946d32c69ab' | ||
); | ||
} | ||
window.addEventListener('DOMContentLoaded', function() { | ||
const outreachCampaignUser = getCookieValue('communityoutreach'); | ||
if (window.location.pathname == '/file-a-complaint/' && outreachCampaignUser) { | ||
const faCLink = document.querySelector('.civil-rights-complaint'); | ||
faCLink.setAttribute('href', 'https://civilrights.justice.gov/report?utm_campaign=61607827-e620-4e59-8850-b946d32c69ab'); | ||
} | ||
}); | ||
} | ||
}); | ||
} |