Skip to content

Instantly share code, notes, and snippets.

@HubSpotHanevold
Created October 16, 2025 16:30
Show Gist options
  • Save HubSpotHanevold/6cd6af21c4e36abc50128c57705fa1e3 to your computer and use it in GitHub Desktop.
Save HubSpotHanevold/6cd6af21c4e36abc50128c57705fa1e3 to your computer and use it in GitHub Desktop.
Identify page URL and assign a fairway company based on URL value
<script>
window.addEventListener('load', function() {
const url = window.location.href.toLowerCase();
const companyInput = document.querySelector('input[name="fairway_company_"]');
if (companyInput) {
if (url.includes('agape')) {
companyInput.value = 'Agape Lawn Company';
} else if (url.includes('fairway')) {
companyInput.value = 'Fairway Lawns';
} else {
companyInput.value = 'Arbor Bay';
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment