HubSpot CRM Integration

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    815

HubSpot CRM Integration with Website

HubSpot is a popular CRM for small and medium business with convenient API and free tier. Integration allows automatic lead addition from website forms, contact synchronization, user activity tracking, and launching automatic email sequences.

Integration Methods

HubSpot Forms API — send form data directly to HubSpot. Simplest method for lead collection.

HubSpot CRM API v3 — full control via REST API. Create and update contacts, deals, tickets.

HubSpot JS Tracking Code — script for tracking site behavior. Links visitor actions (page views, clicks) to contact in CRM.

Sending Lead via Forms API

// Get portal_id and form_id from HubSpot form URL
const PORTAL_ID = '12345678';
const FORM_ID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';

const response = await fetch(
  `https://api.hsforms.com/submissions/v3/integration/submit/${PORTAL_ID}/${FORM_ID}`,
  {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({
      fields: [
        {name: 'firstname', value: formData.firstName},
        {name: 'lastname', value: formData.lastName},
        {name: 'email', value: formData.email},
        {name: 'phone', value: formData.phone},
        {name: 'message', value: formData.message}
      ],
      context: {
        hutk: getCookie('hubspotutk'),  // cookie to link with visit
        pageUri: window.location.href,
        pageName: document.title
      }
    })
  }
);

Field hutk links lead with site visit history — required for correct attribution.

CRM API: Creating Contact and Deal

// composer require hubspot/hubspot-php

$client = \HubSpot\Factory::createWithAccessToken(env('HUBSPOT_ACCESS_TOKEN'));

// Create or update contact (upsert by email)
$contact = $client->crm()->contacts()->basicApi()->create(
    new \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInput([
        'properties' => [
            'email'     => $user->email,
            'firstname' => $user->first_name,
            'phone'     => $user->phone,
            'website_user_id' => $user->id
        ]
    ])
);

// Create deal
$deal = $client->crm()->deals()->basicApi()->create(
    new \HubSpot\Client\Crm\Deals\Model\SimplePublicObjectInput([
        'properties' => [
            'dealname'   => "Order #{$order->id}",
            'amount'     => $order->total / 100,
            'dealstage'  => 'closedwon',
            'closedate'  => $order->created_at->timestamp * 1000 // ms
        ]
    ])
);

// Link deal to contact
$client->crm()->deals()->associationsApi()->create(
    $deal->getId(), 'contact', $contact->getId(), 'deal_to_contact'
);

Webhook for Synchronization

HubSpot supports webhooks: when contact or deal changes, sends notification to website endpoint. Used for status synchronization back to site (e.g., manager closed deal in HubSpot → status on site updates).

HubSpot Lists and Segmentation

Website users can be automatically added to HubSpot lists for segmented email campaigns:

$client->crm()->lists()->membershipsApi()->addAndRemoveMemberships(
    $listId,
    new AddAndRemoveMembershipsInput(['recordIdsToAdd' => [$contactId]])
);

Event Tracking

For advanced tracking — Custom Behavioral Events via API:

$client->events()->send()->basicApi()->sendEvent([
    'eventName' => 'pe123456_product_viewed',
    'email' => $user->email,
    'properties' => ['product_id' => $productId, 'product_name' => $productName]
]);

Integration time: 3–5 days for basic lead and order synchronization. With bidirectional synchronization and event tracking — 1.5–2 weeks.