Objective: Track Rep Firm/Internal Reps' performance toward quarterly dealer sign-up goals without relying on the dealer to self-report who referred them.
Strategy:
Streamline Tracking while maintaining a single, unified dealer application form. Marketing implemented a hidden dropdown field on the form that auto-fills based on a URL query parameter. This setup ensures clean data, minimizes manual steps, support scalable tracking as contacts/partners change or grow, and removes the need for dealer input while keeping rep attribution accurate and centralized.
How it Works:
- Each Sales Rep/Partner firm is assigned a unique referral link
- When a dealer clicks the link, a JavaScript snippet reads the referral value from the URL and selects the matching internal value in the form's hidden dropdown.
- The selected value is stored in the Contact record under a dedicated field for reporting and automation.
Live Example: URL query Autofills Dropdown Field
Note: The Internal Sales Source (Dealer Ap) field is hidden from view. It was temporarily unhidden for demonstration purposes in this video.
URL References:
See Below to create new or modify Properties and Tracking URLs
Any internal sales source, rep firm, partner, or other contact who consistently drives dealers to apply should have a dedicated tracking URL.
The table below outlines the setup for each rep source currently configured:
- The label and internal name used in the HubSpot Property
- The query parameter used to trigger the autofill
- The unique value expected from the URL
- The URL to share with those driving traffic to the form, which pre-fills the hidden field on the Dealer Application form.
Creating or Modifying Properties, URLs, & Script Logic
Property Set Up
🚩 These Steps are only for modifying the existing Internal Sales dourest (Dealer-App) property, not for creating a new property. A new property should only be created if the use case cannot be supported by the existing one.
Property Name: Internal Sales Source (Dealer App)
A Unique custom property was created under the Contact Object in HubSpot to simplify reporting setup and ensure reliable field mapping. Follow the steps below if you need to create a new unique tracking URL tied to this property:
HubSpot Settings
- Go to Settings> Properties, then filter your the Contact object.
- Search for and select the property called, Internal Sales Source (Dealer App).
- Scroll to the Dropdown options section and click the "Add an option." button.
- Label: The name that will display in reports and dropdown (e.g., Access Reps)
- Internal Value: Must match the exact query value used in the URL (e.g., access-reps).
Important:
- Keep the internal name format separated by hyphens and all lowercase
- Example: firstname-lastname, partner-firm-company
- The internal values of the drop down options must match the URL Parameter values exactly.
- Example: If the URL is
?referral=dean-morgan, the internal dropdown value must bydean-morgan
- Example: If the URL is
Including Property to Dealer Application Form
⚠️This step is only necessary when adding a brand-new property to the system. If you're simply updating or modifying values within the existing property, you do not need to re-add the field to the form.
Once the custom property internal_sales_source_dealer_app was created, and it was added to the existing Dealer Application Form in HubSpot to support the automatic population via URL
Steps:
- Go to Marketing > Lead Capture > Forms in HubSpot
- Locate and Edit the Dealer Application Form
- In the left sidebar, search for the field:
- Internal Sales Source (Dealer-App)
- Drag the field into the form
- Click the field and choose "Hidden Field" so it will be hidden from users filling out the form
- Save and Publish the updated form
This allows the JavaScript to match the referral value from the URL with a dropdown option and set it in the background, without user input.
Creating / Updating URL Queries
To dynamically pre-fill the rep firm field on the dealer application form, we use smart rules in HubSpot based on URL query parameters. This allows personalized form experiences depending on which rep shared the link
- Go to the landing page in HubSpot where the form is embedded.
- Click on the form
- On top of the open panel on the left, you'll see "Smart Rules."
- Click on Manage
Important:
- Always set th parameter name to: referral
- Ensure the query value matches the internal property name
- Example:
- Internal Name = alr-associated-lighting
- URL Paramater = partner =alr-associated-lighting

URL Value:
https://web.icrealtime.com/dealer-application?referral=alr-associated-lighting
Modifying the JavaScript Query:
⚠️ Only Update the JavaScript if:
A New property is created (with a new internal name)
The query parameter changes (e.g., from referral to something else)
The script needs to be added to a new landing page that doesn't already have it
Use this ChatGPT Prompt:
This prompt is already configured with the necessary information provided below.
I'm working with a HubSpot form that includes a dropdown field. I want the dropdown to automatically select a value based on a query parameter in the page URL.
The dropdown's internal field name is internal_sales_source_dealer_app, and the query parameter is called referral (e.g., referral=alr-associated-lighting).
Please Generate a JavaScript snippet that:
- Works with dynamically loaded HubSpot forms (via MutationObserver)
- Waits until the form and field are fully loaded
- Sets the dropdown value if a match is found
- Avoids naming conflicts with other scripts on the pages
- Logs success/failure clearly in the browser console
Once the JavaScript is generated/updated, it's inserted into the landing page's settings:
Current JavaScript Used (July 2025)
<script>
const REFERRAL_PARAM = new URLSearchParams(window.location.search).get("referral");
const REFERRAL_FIELD = "internal_sales_source_dealer_app";
function setDropdownFieldValue() {
const dropdown = document.querySelector(`select[name="${REFERRAL_FIELD}"]`);
if (!dropdown) {
console.warn("❌ Dropdown not found.");
return;
}
if (REFERRAL_PARAM) {
const match = dropdown.querySelector(`option[value="${REFERRAL_PARAM}"]`);
if (match) {
dropdown.value = REFERRAL_PARAM;
dropdown.dispatchEvent(new Event("change", { bubbles: true }));
console.log(`✅ Set dropdown to: "${REFERRAL_PARAM}"`);
} else {
console.warn(`⚠️ Value "${REFERRAL_PARAM}" not found in dropdown options.`);
}
} else {
console.warn("⚠️ No referral param in URL — dropdown left blank.");
}
// Visually disable the field without actually disabling it
dropdown.setAttribute("readonly", true); // not officially valid on select but safe
dropdown.style.pointerEvents = "none";
dropdown.style.backgroundColor = "#f9f9f9";
dropdown.style.color = "#555";
dropdown.style.opacity = "0.8";
console.log("🔒 Dropdown visually locked (readonly workaround).");
}
function waitForReferralDropdown() {
const observer = new MutationObserver(() => {
const dropdown = document.querySelector(`select[name="${REFERRAL_FIELD}"]`);
if (dropdown) {
setDropdownFieldValue();
observer.disconnect();
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
}
document.addEventListener("DOMContentLoaded", waitForReferralDropdown);
</script>
Troubleshooting Shortcuts:
Dealer Application Set Up:
|
Live Page |
Dealer Application | Link to Dealer App (Located on Website Footer) |
| Landing Page | Dealer Application | Link to Edit Page |
| Form | Dealer Application Form |
Link to Edit Form |
| Property | Internal Sales Source (Dealer-App) | Link to Add Properties |
Post Application Submission Workflow Triggers
Operational Workflows:
| Workflow Internal Vetting | 1.0 | Operations Vetting | Dealer Application Submitted | Assign Contact Owner | Creates Deal Record & Task to Review Application - Assign to Jerrold Effron |
| Workflow Internal Record Updates | 2.0 | Operations Vetting | Dealer Application Approved | Assign Company/Contact Owner | Sets record with data based on assigned Sales Executive |
| Workflow Internal Record Updates & External Communication | 3.0 | New Dealer Pipeline | Dealer Application Approval | Set Deal Stage | Communicates new approved dealers to sales leaders and sends welcome email from CEO to dealer |
Onboarding Workflows:
| Workflow (Internal Record Updates) | 4.0.1 | New Dealer Pipeline | Assign Onboarding Agent | Assigns Onboarding Agent to Trigger 1:1 Onboarding Invitation | |
| Workflow External Communication | 4.1 | New Dealer Pipeline | Dealer Application Approved | Schedule Onboarding | Triggers email from onboarding agent to customer to scheduled their onboarding (with reminder emails) | |
| Workflow (Internal Communication) | 4.1 | New Dealer Pipeline | Onboarding Scheduled | Create Task | Onboarding scheduled via meeting link, task is assigned to agent | |
| Workflow (External Communication) | 4.2 | New Dealer Pipeline | Reschedule Onboarding 09.30.24 | If Dealer does not attend scheduled onboarding, an email is sent to dealer to reschedule | |
| Workflow (Internal Communication) | 4.3 | New Dealer Pipeline | Rescheduled Onboarding Task | Onboarding rescheduled via meeting link, task is assigned to agent | |
| Workflow (External Communication) | 5.0 New Dealer Pipeline | Onboarding Completed/Next Steps 10.01.24 | Onboarding completed, email sent to dealer with the next steps | |
| Workflow (External Communication) | 5.1 New Dealer Pipeline | Onboarding Completed 60 day Follow-Up Workflow 10.09.24 |
|
|
| Post Onboarding Survey External Communication | 5.2 Post Onboarding Survey l Customer Success
|
Post Onboarding l Sends Survey |