HubSpot
CRM revenue attribution for B2B teams
Overview
The HubSpot integration connects your CRM data to visitor analytics. When deals close, Loamly shows which traffic sources drove that revenue.
With HubSpot connected, you can answer:
- How much pipeline came from ChatGPT referrals?
- Which AI platform drives the highest-value leads?
- What is the conversion rate from AI traffic to closed deals?
- Which traffic source has the shortest sales cycle?
Connect your HubSpot account
- Go to your Loamly dashboard → Settings → Integrations
- Find HubSpot CRM and click Connect
- You will be redirected to HubSpot to authorize the connection
- Review the permissions and click Connect app
- You will be redirected back to Loamly
- Configure your pipeline settings (which stages count as closed-won)
Permissions requested
How attribution works
Loamly matches HubSpot contacts to website visitors using timestamp correlation:
- Visitor tracking: When someone visits your site, Loamly creates a visitor record and tracks their journey
- Form submission: When the visitor submits a form, Loamly records the timestamp
- Contact creation: When a contact is created in HubSpot, Loamly receives a webhook notification
- Correlation: Loamly matches the form submission timestamp to the contact creation timestamp
- Attribution: The visitor's traffic source is synced to the HubSpot contact as custom properties
Form tracking requirement
Attribution window
Loamly uses a 5-minute correlation window by default. If a form submission and HubSpot contact creation happen within 5 minutes of each other, they are matched with high confidence.
Custom properties
When you connect HubSpot, Loamly automatically creates a property group called Loamly with these contact properties:
General source tracking
| Property | Description |
|---|---|
loamly_visitor_id | Unique visitor identifier for full journey tracking |
loamly_first_source | First traffic source (google, linkedin, chatgpt, direct) |
loamly_first_medium | First traffic medium (organic, paid, ai, referral) |
loamly_first_referrer | Full referrer URL of the first visit |
loamly_utm_campaign | UTM campaign parameter from first visit |
AI-specific tracking
| Property | Description |
|---|---|
loamly_ai_source | AI platform (chatgpt, claude, perplexity) |
loamly_ai_query | The query the user asked (if available) |
loamly_first_ai_visit | Date of first AI-referred visit |
loamly_last_ai_visit | Date of most recent AI-referred visit |
loamly_ai_visit_count | Total number of AI-referred visits |
Attribution metadata
| Property | Description |
|---|---|
loamly_attribution_confidence | Confidence score of the match (0-100) |
loamly_attributed_at | Timestamp when attribution was applied |
Deal attribution
When a deal moves to a closed-won stage, Loamly automatically attributes the revenue to the original traffic source:
- HubSpot sends a webhook when the deal stage changes
- Loamly looks up the associated contact
- If the contact has a
loamly_visitor_id, the deal is attributed - Revenue appears in your Loamly dashboard by source
Configuration
In Loamly settings, you can configure:
- Pipeline: Which HubSpot pipeline to track
- Closed-won stages: Which stages count as revenue
- Amount field: Which property to use for deal value
- Attribution model: First-touch or last-touch
- Attribution window: How far back to look (default 90 days)
Privacy and security
Data access:
- Loamly uses OAuth 2.0 for secure authentication
- We request only the permissions needed for attribution
- We create custom properties but do not modify existing data
- We receive webhooks for contact and deal events
Webhook security:
- All webhooks are verified using HubSpot V3 signatures
- Requests are validated for replay attack prevention
- Invalid signatures are rejected with 401 Unauthorized
Data storage:
- Attribution data is stored in your Loamly workspace
- You can disconnect HubSpot at any time from Settings
- Disconnecting stops syncing but retains historical data
Enterprise-ready