Request form with 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

Developing a request form with CRM integration

A form on the website whose data automatically reaches the CRM is a standard task for lead-generating sites. The manager receives a notification, the lead appears in the funnel, correspondence history is saved. Without manual data transfer.

Popular CRMs and integration methods

CRM Integration method Complexity
amoCRM REST API + webhooks Medium
Bitrix24 REST API / Open Channel High
HubSpot Forms API / Contacts API Low
Salesforce REST API / Lead object High
Pipedrive REST API Low

amoCRM integration

class AmoCrmService
{
    private string $subdomain;
    private string $accessToken;

    public function createLead(array $formData): int
    {
        $resp = Http::withToken($this->accessToken)
            ->post("https://{$this->subdomain}.amocrm.ru/api/v4/leads", [
                [
                    'name'           => "Request from website: {$formData['name']}",
                    'status_id'      => config('amocrm.initial_status_id'),
                    'pipeline_id'    => config('amocrm.pipeline_id'),
                    '_embedded' => [
                        'contacts' => [[
                            'name' => $formData['name'],
                            'custom_fields_values' => [
                                ['field_code' => 'EMAIL', 'values' => [['value' => $formData['email']]]],
                                ['field_code' => 'PHONE', 'values' => [['value' => $formData['phone'], 'enum_code' => 'WORK']]],
                            ],
                        ]],
                    ],
                    'custom_fields_values' => [
                        ['field_id' => config('amocrm.source_field_id'), 'values' => [['value' => 'Website']]],
                        ['field_id' => config('amocrm.comment_field_id'), 'values' => [['value' => $formData['message']]]],
                    ],
                ]
            ]);

        return $resp->json('_embedded.leads.0.id');
    }
}

amoCRM OAuth2 tokens

amoCRM uses OAuth2 with refresh_token. Tokens need updating every 24 hours:

class AmoCrmTokenManager
{
    public function getValidToken(): string
    {
        $stored = Cache::get('amocrm_access_token');
        if ($stored) return $stored;

        // Update via refresh_token
        $resp = Http::post("https://{$this->subdomain}.amocrm.ru/oauth2/access_token", [
            'client_id'     => config('amocrm.client_id'),
            'client_secret' => config('amocrm.client_secret'),
            'grant_type'    => 'refresh_token',
            'refresh_token' => decrypt(Setting::get('amocrm_refresh_token')),
            'redirect_uri'  => config('amocrm.redirect_uri'),
        ]);

        $tokens = $resp->json();
        Cache::put('amocrm_access_token', $tokens['access_token'], 82800);  // 23 hours
        Setting::set('amocrm_refresh_token', encrypt($tokens['refresh_token']));

        return $tokens['access_token'];
    }
}

UTM tags in request

Traffic source is fixed in cookies on first visit and sent with the form:

// Save UTM on first visit
const utmParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];
const params    = new URLSearchParams(window.location.search);

utmParams.forEach(param => {
  if (params.has(param)) {
    document.cookie = `${param}=${params.get(param)};path=/;max-age=2592000`;
  }
});

// Add UTM when submitting form
function getUtmData() {
  return Object.fromEntries(
    utmParams.map(p => [p, getCookie(p) || '']).filter(([, v]) => v)
  );
}

Timeline

Request form with integration into one CRM via API: 3–5 working days.