Set up your CRM
To attribute prospects to marketing, Roadway needs three CRM datasets and an anonymous ID on each contact.
What Roadway models
Roadway treats a prospect's progression in two stages:
- Lead lifecycle. A contact (or lead) moves through lifecycle stages, such as subscriber, lead, marketing qualified lead (MQL), and sales qualified lead (SQL).
- Opportunity or deal stages. Once qualified, the contact is associated with an opportunity (Salesforce) or deal (HubSpot), which moves through pipeline stages to closed won or closed lost.
CRM tables
On the warehouse path, you build these tables. With a direct HubSpot or Salesforce connector, Roadway builds them. You tell Roadway your stages. To link contacts to visits, also add the anonymous ID property.
| Dataset | Table | What it tracks |
|---|---|---|
| Contacts and leads | dim__contacts |
Each contact, the date it reached each lifecycle stage, and the visitor_id from the form |
| Opportunities and deals | dim__opportunities (dim__deals) |
Each opportunity, the dates it reached each stage, and whether it closed won |
| Pipeline ARR | fact__pipeline_arr_snapshot |
Daily pipeline value, weighted by close probability |
See Revenue and CRM tables for the full schemas.
The attribution link
Marketing credit flows through the contact:
page views ──visitor_id──► dim__contacts ──contact_id──► dim__opportunities ──► closed won
Without visitor_id on the contact, the chain breaks at the first arrow. The contact still counts in your CRM funnel, but isn't linked to website visits. See the forms guides to add the ID.
Choose your guide
| CRM | Guide |
|---|---|
| HubSpot | HubSpot CRM |
| Salesforce | Salesforce CRM |
| HubSpot syncing to Salesforce | HubSpot to Salesforce |
| Map your stages to Roadway's columns | Lifecycle stages and pipelines |
Connect your CRM
- Direct connector. See Connect HubSpot or Connect Salesforce.
- Warehouse. Land CRM data with your ETL tool (Fivetran, Airbyte, and others) and model the three tables. See Revenue and CRM tables.
HubSpot
To connect HubSpot to Roadway, see Connect HubSpot.
You need:
- A HubSpot user who can create contact properties and edit forms
Steps
- Link contacts to visits. Choose one of two options:
- Option A: a contact property. Create the anonymous ID property and add it to forms. Follow HubSpot forms. The property is on the Contact object, type single-line text. Don't start its internal name with
hs_orhubspot_, and don't includesalesforce. Tell Roadway the internal name. - Option B: HubSpot forms with GA4, no property. Roadway joins HubSpot's form cookie (UTK) to the contact. This needs the GA4 BigQuery export and the HubSpot form-submission event. Roadway turns it on for your workspace, or can add the event and variable for you if you invite
contact@roadwayai.comto GTM.
- Option A: a contact property. Create the anonymous ID property and add it to forms. Follow HubSpot forms. The property is on the Contact object, type single-line text. Don't start its internal name with
- Check lifecycle stages. Go to Settings > Objects > Contacts > Lifecycle stages (in some accounts, Properties), and confirm the stages you use are the stages you want in Roadway. See Lifecycle stages and pipelines.
- Check deal pipelines. Go to Settings > Objects > Deals > Pipelines, and note each pipeline and stage. Tell Roadway if you use more than one. Multiple pipelines need custom modeling.
- Associate deals with the right contact. Roadway credits each deal to its oldest associated contact. Make sure the contact who first converted is associated, and remove earlier-created contacts who weren't part of the deal.
- Keep the property populated for all entry paths. Contacts created by import, API, chat, or meetings booking won't have the ID. Roadway can't attribute those unless another source supplies it.
What Roadway reads
| Roadway column | HubSpot source |
|---|---|
contact_id |
Contact Record ID |
visitor_id |
One agreed contact property (default ga4_pseudo_user_id), or the UTK mapping |
created_date |
Contact create date |
<stage>_reached_date |
HubSpot's Date entered <stage> properties (hs_v2_date_entered_<stage id>) |
opportunity_id (deal_id) |
Deal record ID |
contact_id is the HubSpot contact Record ID. Roadway reads one visitor-ID property, agreed during onboarding, and doesn't combine several. A deal is attributed through its oldest associated contact.
Verify
- In HubSpot, create a test contact through a form with the anonymous ID field.
- Confirm the contact has the anonymous ID property filled.
- After Roadway syncs, confirm the contact appears with a non-null
visitor_id.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Many contacts with no ID | Contacts created outside forms with the ID field | Expected. Measure the share and tell Roadway |
| Property exists but is never filled | Not on the form as a hidden field | See HubSpot forms |
| Deals attributed to the wrong contact | An earlier-created contact is associated with the deal | Remove contacts who weren't part of the deal |
Vendor docs: HubSpot properties, Lifecycle stages
Salesforce
To connect Salesforce to Roadway, see Connect Salesforce.
You need:
- Salesforce admin access
- Your form provider and analytics tool. See Capture IDs in forms.
Steps
- Create the custom field.
- In Setup, open Object Manager and select Contact.
- Click Fields & Relationships, then New.
- For Data Type, select Text and click Next.
- For Field Label, enter
ga4_pseudo_user_id. Salesforce sets the Field Name and API namega4_pseudo_user_id__c. - Set Length to
255and click Next. - On Establish field-level security, make the field visible and editable for the profiles and permission sets that your form integration and Roadway's user use. Click Next.
- On Add to page layouts, click Save.
- Repeat on the Lead object. Put the field on both objects. Then go to Object Manager > Lead > Fields & Relationships > Map Lead Fields and map the Lead field to the Contact field, so conversion keeps the value.
- Add the hidden field to your form with the matching name. See Capture IDs in forms.
- Map the form field to Salesforce. In your form integration, add a mapping from the field to the Salesforce field.
- Check opportunity contact roles. Roadway attributes an opportunity through its primary contact (
Opportunity.ContactId). Make sure opportunities have a primary contact role. - Create a date field per lifecycle stage, for example
MQL_Date__c, or tell Roadway which fields you already use. Roadway reads only these custom per-stage date fields. The current stage comes fromLifecycle_Stage__c.
You can also give Roadway an admin user and have Roadway add the field and mapping for you.
For Segment, use the label segment_anon_id. For PostHog, use posthog_device_id and tell Roadway whether it holds the device ID or the distinct ID.
What Roadway reads
| Roadway column | Salesforce source |
|---|---|
contact_id |
Contact Id (default), or Lead Id when Roadway models your funnel on Leads |
visitor_id |
Your anonymous ID custom field |
created_date |
CreatedDate |
<stage>_reached_date |
One custom date field per stage named during onboarding, for example MQL Date (null if none is set up). Opportunity stage dates come from Opportunity History. |
opportunity_id |
Opportunity ID |
closed_date, is_closed_won |
CloseDate, IsWon |
Roadway reads Contacts by default, or Leads, chosen for your workspace. It reads one object and one column, never both. Put the field on both objects and map it in lead conversion. Deals use Opportunity.ContactId.
Verify
- Submit a test form.
- In Salesforce, open the resulting Lead or Contact and confirm the field has a value.
- If you use Leads, convert the test Lead and confirm the Contact keeps the value.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Field empty | Mapping missing, or field-level security hides it | Add mapping. Grant access |
| Value lost on conversion | Lead field not mapped to Contact field | Use Map Lead Fields |
| Duplicate fields | A second field with a similar name | Keep one and map it |
Vendor docs: Create custom fields (Salesforce), Map custom lead fields for lead conversion (Salesforce)
HubSpot to Salesforce sync
If you capture forms in HubSpot and sync contacts to Salesforce, the anonymous ID has to cross the sync.
Create the field in both systems and map it in HubSpot's Salesforce integration.
You need:
- The HubSpot property exists and is on your forms. See HubSpot forms.
- HubSpot's Salesforce integration is installed and connected.
- Admin access to HubSpot and Salesforce.
Steps
- Create the Salesforce field. Follow Salesforce CRM steps 1 and 2, using the same label as the HubSpot property.
- Open the integration settings. In HubSpot, go to Settings > Integrations > Connected apps > Salesforce > Manage > Settings.
- Check contact sync. Confirm that contacts created or updated in HubSpot create or update the contact in Salesforce.
- Add the field mapping. Go to Contacts > Property mappings, click Add new mapping, choose the HubSpot property on the left and the Salesforce field on the right.
- Choose a sync rule. Use Two-way. HubSpot creates Salesforce records as Leads by default.
- Save the mapping.
Verify
- Submit a test form in HubSpot.
- Wait for the sync, then open the Salesforce contact.
- Confirm the field has the same value as the HubSpot property.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Field not listed in the mapping | Salesforce field-level security hides it from the integration user | Grant access |
| Mapping saved but value empty | Sync rule prevents overwrite | Use Two-way |
| Sync errors | Field type mismatch | Use text on both sides |
Vendor docs: Map HubSpot properties to Salesforce fields