Documentation

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

  1. Go to your Loamly dashboard → Settings Integrations
  2. Find HubSpot CRM and click Connect
  3. You will be redirected to HubSpot to authorize the connection
  4. Review the permissions and click Connect app
  5. You will be redirected back to Loamly
  6. Configure your pipeline settings (which stages count as closed-won)

Permissions requested

Loamly requests access to contacts, deals, and companies. We create custom properties on contacts to store attribution data. We do not modify your existing data.

How attribution works

Loamly matches HubSpot contacts to website visitors using timestamp correlation:

  1. Visitor tracking: When someone visits your site, Loamly creates a visitor record and tracks their journey
  2. Form submission: When the visitor submits a form, Loamly records the timestamp
  3. Contact creation: When a contact is created in HubSpot, Loamly receives a webhook notification
  4. Correlation: Loamly matches the form submission timestamp to the contact creation timestamp
  5. Attribution: The visitor's traffic source is synced to the HubSpot contact as custom properties

Form tracking requirement

Attribution requires that visitors submit a form on your website before becoming HubSpot contacts. The form can be any standard HTML form, HubSpot embedded form, or third-party form tool.

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

PropertyDescription
loamly_visitor_idUnique visitor identifier for full journey tracking
loamly_first_sourceFirst traffic source (google, linkedin, chatgpt, direct)
loamly_first_mediumFirst traffic medium (organic, paid, ai, referral)
loamly_first_referrerFull referrer URL of the first visit
loamly_utm_campaignUTM campaign parameter from first visit

AI-specific tracking

PropertyDescription
loamly_ai_sourceAI platform (chatgpt, claude, perplexity)
loamly_ai_queryThe query the user asked (if available)
loamly_first_ai_visitDate of first AI-referred visit
loamly_last_ai_visitDate of most recent AI-referred visit
loamly_ai_visit_countTotal number of AI-referred visits

Attribution metadata

PropertyDescription
loamly_attribution_confidenceConfidence score of the match (0-100)
loamly_attributed_atTimestamp 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:

  1. HubSpot sends a webhook when the deal stage changes
  2. Loamly looks up the associated contact
  3. If the contact has a loamly_visitor_id, the deal is attributed
  4. 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

Loamly follows HubSpot's security best practices including signature verification, encrypted data storage, and minimal permission scopes.