Deferred lead tracking

Learn how to record deferred lead conversions with LinkKit.

Learn how to record deferred lead conversions with LinkKit.

Business Plan Requirement
This feature is available on LinkKit Business plans and higher.

When tracking conversions, a lead event occurs when a user takes an action that demonstrates interest in your product or service. Common examples include:

  • Creating an account
  • Scheduling a demo or consultation
  • Subscribing to a newsletter or mailing list

These actions help identify potential customers and mark an important step in the conversion journey.

However, a signup isn't always the most meaningful indicator of a qualified lead. In some cases, you may want to track a more valuable action that reflects genuine product engagement, such as:

  • A user completing their first meeting in your application
  • A user performing their first search query
  • A user reaching a key usage milestone, such as dictating their first 2,000 words
  • A user completing an important onboarding step

In these scenarios, deferred lead tracking allows you to postpone lead creation until the user completes the action that matters most. This ensures that lead events are recorded based on meaningful engagement rather than an initial signup alone.

Deferred Lead Tracking
Deferred lead tracking is especially useful for monitoring sales-qualified leads (SQLs), helping improve marketing attribution and ensuring partners are rewarded for qualified leads rather than just signups through LinkKit Partners.

Prerequisites

Before you can start tracking conversions, you'll need to enable conversion tracking for your LinkKit links.

Once conversion tracking is enabled, LinkKit can attribute and record lead and sales events associated with your links.

LinkKit Partners
If you're using LinkKit Partners, you can skip this step because conversion tracking is enabled by default for all partner links.
Option 1: Enable Conversion Tracking at the Workspace Level
To automatically enable conversion tracking for all new links created within a workspace:

Navigate to your workspace's Tracking Settings page.
Enable the Workspace Conversion Tracking toggle.

Once enabled, conversion tracking will be applied to all future links created in that workspace, so you won't need to configure it individually for each new link.
Option 2: Enable Conversion Tracking for a Specific Link
If you'd rather not enable conversion tracking for every link in a workspace, you can turn it on individually for selected links.

To enable conversion tracking for a specific link:

Open the LinkKit Link Builder for the link you want to track.
Turn on the Conversion Tracking toggle.

This will enable conversion tracking only for that link, giving you more control over which links collect conversion data.
Option 3: Enable Conversion Tracking via the API
You can also enable conversion tracking programmatically using the LinkKit API.

When creating or updating a link, include the trackConversion: true parameter in your API request. This will enable conversion tracking for that link automatically.

Once conversion tracking is enabled, you'll need to install the LinkKit Analytics script on your website to start tracking conversion events.

The LinkKit Analytics script can be installed in several ways, depending on your website setup and preferred implementation method:

Verify the Installation
You can confirm that the LinkKit Analytics script has been installed correctly by performing the following checks:

Open your browser's developer console and enter _linkkitAnalytics.
If the script is loaded successfully, the _linkkitAnalytics object should appear in the console.
Add the ?linkkit_id=test query parameter to your website URL.
Then verify that the linkkit_id cookie is being set in your browser.

If both checks succeed, the analytics script is installed and functioning correctly.

If not, make sure that:

The analytics script has been added to the <head> section of your page.
If you're using a CDN, clear or purge any cached content to ensure the latest version of the page is being served.

Step 1: Track a Deferred Lead Event

The first step is to record a deferred lead event when a user takes an initial action that indicates interest in your product or service. Examples include:

  • Creating an account
  • Booking a demo through HubSpot
  • Subscribing to a newsletter or mailing list

To defer lead creation, set the mode property to deferred when sending the lead event.

With this configuration, LinkKit will still capture the customer information and associate it with the originating click ID, but it will postpone creating the actual lead event until a later request is made. This allows you to attribute the lead only after the user completes a more meaningful engagement action.

import { LinkKit } from "linkkit";

const linkkit = new LinkKit();

const linkkitId = req.cookies["linkkit_id"];
if (linkkitId) {
  await linkkit.track.lead({
    clickId: linkkitId,
    mode: "deferred",
    eventName: "Sign Up",
    customerExternalId: customer.id,
    customerName: customer.name,
    customerEmail: customer.email,
    customerAvatar: customer.avatar,
  });
  // delete the linkkit_id cookie
  res.cookies.set("linkkit_id", "", {
    expires: new Date(0),
  });
}
from linkkit import LinkKit
import os

linkkit = LinkKit(token=os.environ['LINKKIT_API_KEY'])

linkkit_id = request.cookies.get('linkkit_id')
if linkkit_id:
    linkkit.track.lead({
        'click_id': linkkit_id,
        'mode': 'deferred',
        'event_name': 'Sign Up',
        'external_id': customer.id,
        'customer_name': customer.name,
        'customer_email': customer.email,
        'customer_avatar': customer.avatar
    })
    # delete the linkkit_id cookie
    response.delete_cookie('linkkit_id')
package main

import (
    "context"
    linkkit "github.com/linkkit/linkkit-go"
    "net/http"
)

d := linkkit.New(
    linkkit.WithSecurity(os.Getenv("LINKKIT_API_KEY")),
)

linkkitId, err := r.Cookie("linkkit_id")
if err == nil {
    _, err = d.Track.Lead(context.Background(), &operations.TrackLeadRequest{
        ClickId:             linkkitId.Value,
        Mode:                "deferred",
        EventName:           "Sign Up",
        CustomerExternalId:  customer.ID,
        CustomerName:        customer.Name,
        CustomerEmail:       customer.Email,
        CustomerAvatar:      customer.Avatar,
    })
    // delete the linkkit_id cookie
    http.SetCookie(w, &http.Cookie{
        Name:    "linkkit_id",
        Value:   "",
        Expires: time.Unix(0, 0),
    })
}
require 'linkkit'

linkkit = ::OpenApiSDK::LinkKit.new
linkkit.config_security(
  ::OpenApiSDK::Shared::Security.new(
    token: ENV['LINKKIT_API_KEY']
  )
)

linkkit_id = cookies[:linkkit_id]
if linkkit_id
  req = ::OpenApiSDK::Operations::TrackLeadRequest.new(
    click_id: linkkit_id,
    mode: 'deferred',
    event_name: 'Sign Up',
    external_id: customer.id,
    customer_name: customer.name,
    customer_email: customer.email,
    customer_avatar: customer.avatar
  )
  linkkit.track.lead(req)
  # delete the linkkit_id cookie
  cookies.delete(:linkkit_id)
end
<?php

require 'vendor/autoload.php';

use LinkKit\LinkKit;
use LinkKit\Models\Operations;

$linkkit = LinkKit::builder()->setSecurity($_ENV["LINKKIT_API_KEY"])->build();

$linkkitId = $_COOKIE['linkkit_id'] ?? null;
if ($linkkitId) {
    $request = new Operations\TrackLeadRequest();
    $request->clickId = $linkkitId;
    $request->mode = 'deferred';
    $request->eventName = 'Sign Up';
    $request->customerExternalId = $customer->id;
    $request->customerName = $customer->name;
    $request->customerEmail = $customer->email;
    $request->customerAvatar = $customer->avatar;

    $linkkit->track->lead($request);
    // delete the linkkit_id cookie
    setcookie('linkkit_id', '', time() - 3600);
}

Step 2: Track a Qualified Lead Event

Once the user completes the action that qualifies them as a lead, you can record the actual lead conversion event.

To do this, send the same lead tracking request used previously, but with the following changes:

  • Remove the mode property so the event is processed normally.
  • Set clickId to an empty string ("").

When clickId is empty, LinkKit will look up the customer using the provided customerExternalId. If a matching customer is found, LinkKit will use the click ID associated with that customer to attribute the lead conversion correctly.

This approach allows you to delay lead attribution until the user completes a meaningful action, while still preserving the original click attribution data.

import { LinkKit } from "linkkit";

const linkkit = new LinkKit();

await linkkit.track.lead({
  clickId: "",
  eventName: "Sign Up",
  customerExternalId: customer.id,
  customerName: customer.name,
  customerEmail: customer.email,
  customerAvatar: customer.avatar,
});
from linkkit import LinkKit
import os

linkkit = LinkKit(token=os.environ['LINKKIT_API_KEY'])

linkkit.track.lead({
    'click_id': '',
    'event_name': 'Sign Up',
    'external_id': customer.id,
    'customer_name': customer.name,
    'customer_email': customer.email,
    'customer_avatar': customer.avatar
})
package main

import (
    "context"
    linkkit "github.com/linkkit/linkkit-go"
    "net/http"
)

d := linkkit.New(
    linkkit.WithSecurity(os.Getenv("LINKKIT_API_KEY")),
)

d.Track.Lead(context.Background(), &operations.TrackLeadRequest{
    ClickId:             "",
    EventName:           "Sign Up",
    CustomerExternalId:  customer.ID,
    CustomerName:        customer.Name,
    CustomerEmail:       customer.Email,
    CustomerAvatar:      customer.Avatar,
})
require 'linkkit'

linkkit = ::OpenApiSDK::LinkKit.new
linkkit.config_security(
  ::OpenApiSDK::Shared::Security.new(
    token: ENV['LINKKIT_API_KEY']
  )
)

req = ::OpenApiSDK::Operations::TrackLeadRequest.new(
    click_id: '',
    event_name: 'Sign Up',
    external_id: customer.id,
    customer_name: customer.name,
    customer_email: customer.email,
    customer_avatar: customer.avatar
)
linkkit.track.lead(req)
<?php

require 'vendor/autoload.php';

use LinkKit\LinkKit;
use LinkKit\Models\Operations;

$linkkit = LinkKit::builder()->setSecurity($_ENV["LINKKIT_API_KEY"])->build();

$request = new Operations\TrackLeadRequest();
$request->clickId = '';
$request->eventName = 'Sign Up';
$request->customerExternalId = $customer->id;
$request->customerName = $customer->name;
$request->customerEmail = $customer->email;
$request->customerAvatar = $customer->avatar;

$linkkit->track->lead($request);

View Your Conversions

Once setup is complete, all tracked conversion events will be available in LinkKit Analytics.

To help you analyze conversion performance, LinkKit provides several reporting views:

Time-Series View

Monitor conversion trends over time with a time-series chart that displays:

  • Clicks – The total number of tracked link clicks.
  • Leads – The number of lead conversion events recorded.
  • Sales – The number of completed sales conversions.

This view helps you understand how users progress through your funnel and how conversion performance changes over time.

Funnel Chart View

Visualize your conversion funnel with a funnel chart that shows conversion and drop-off rates at each stage of the customer journey:

Clicks → Leads → Sales

This view helps you identify how effectively users move through the funnel and where potential customers are dropping off, making it easier to optimize each stage and improve overall conversion performance.

Real-Time Events Stream

Track conversion activity as it happens with a real-time event stream that displays every conversion event recorded across all links in your workspace.

This view provides immediate visibility into:

  • Lead conversions as they occur
  • Sales conversions in real time
  • Attribution details associated with each conversion
  • Recent activity across all tracked links in a single live feed

The real-time events stream is especially useful for monitoring active campaigns, validating conversion tracking, and staying up to date with customer activity as it happens.