Segment

Discover how to track conversion events for sales with Segment and LinkKit.

Discover how to track conversion events for sales with Segment and LinkKit.

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

LinkKit’s Segment integration enables a two-way sync between your Segment workspace and LinkKit. The integration consists of two components:

  • LinkKit (Actions) Destination – Track conversion events in LinkKit directly from Segment.
  • LinkKit Source – Send customer activity and events from LinkKit to Segment.

In this guide, we'll focus on the LinkKit (Actions) Destination and how to track conversion events directly from Segment.

Prerequisites

Before you begin, make sure conversion tracking is enabled for your LinkKit links so you can start recording and measuring conversions.

LinkKit Partners
If you're using LinkKit Partners, you can skip this step, as conversion tracking is automatically enabled 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:

Go to your workspace's Tracking Settings page.
Turn on the Workspace Conversion Tracking toggle.

Once enabled, conversion tracking will be applied to all future links created in that workspace.
Option 2: Enable Conversion Tracking for Individual Links
If you'd prefer not to enable conversion tracking across an entire workspace, you can turn it on for specific links only.

To enable conversion tracking for a particular link:

Open the LinkKit Link Builder for the desired link.
Turn on the Conversion Tracking toggle.

This will enable conversion tracking only for that link, leaving all other links unchanged.
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, simply set trackConversion: true in your API request to enable conversion tracking for that link.

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

There are several ways to add the LinkKit Analytics script to your site:

Verify Your 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, you should see the _linkkitAnalytics object returned in the console.
Add the ?linkkit_id=test query parameter to your website URL.
Verify that the linkkit_id cookie is created in your browser.

If both checks are successful, the analytics script is installed and working correctly.

If not, make sure that:

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

Configure the Segment Action

Next, set up the LinkKit (Actions) destination in Segment to track sales conversion events.

1. Add the LinkKit (Actions) Destination

Go to Segment LinkKit (Actions) and add the destination to your Segment workspace. This will allow Segment to send conversion event data directly to LinkKit.

2. Configure Your LinkKit API Key

In the LinkKit (Actions) destination settings, complete the following fields:

  • Name – Enter a descriptive name to help you identify this destination within Segment.
  • API Key – Enter your LinkKit API key. You can find it in the LinkKit Dashboard.
  • Enable Destination – Turn this option on to allow Segment to send event data to LinkKit.

After completing the configuration, click Save Changes to apply your settings.

3. Add an Event Mapping

Next, select the appropriate action based on the type of conversion event you want to track.

Event Type

Default Event Name

Example

Lead

Sign Up

A user creates a new account or submits a lead form.

Sale

Order Completed

A customer completes a purchase or transaction.

Choose the action that best matches the event you want Segment to send to LinkKit for conversion tracking.

Below the selected action, you’ll see the mapping for that action.

You can customize the trigger conditions and field mappings to match your application's specific requirements.

Once you've finished configuring the mapping, click Next, then select Save and Enable to activate it for the destination.

4. Send Conversion Events to LinkKit

On your server, use the @segment/analytics-node SDK to send conversion events to Segment.

When sending events, be sure to include all relevant properties in the payload so that LinkKit can accurately attribute and track the conversion.

import { Analytics } from "@segment/analytics-node";

const segment = new Analytics({
  writeKey: "<YOUR_SEGMENT_WRITE_KEY>",
});

const cookieStore = await cookies();
const clickId = cookieStore.get("linkkit_id")?.value;

segment.track({
  userId: id,
  event: "Sign Up",
  context: {
    traits: {
      name,
      email,
      avatar,
      clickId,
    },
  },
  integrations: {
    All: true,
  },
});
import { Analytics } from "@segment/analytics-node";

const segment = new Analytics({
  writeKey: "<YOUR_SEGMENT_WRITE_KEY>",
});

segment.track({
  userId: id,
  event: "Order Completed",
  properties: {
    payment_processor: "stripe",
    order_id: "ORD_123",
    currency: "USD",
    revenue: 1000,
  },
  integrations: {
    All: true,
  },
});

Once the event is recorded, Segment will automatically send the conversion data to LinkKit according to the mappings you've configured in your destination settings.

Supported attributes

Lead Event Properties

The following properties can be included when sending a lead event to LinkKit:

Property

Required

Description

clickId

Yes

The unique identifier of the click associated with the lead conversion. This value can be retrieved from the linkkit_id cookie. If an empty string is provided (for deferred lead tracking), LinkKit will attempt to locate an existing customer using customerExternalId and use the associated clickId if available.

eventName

Yes

The name of the lead event being tracked. This can also serve as a unique identifier when associating a lead event with a future sale event (using the leadEventName property when tracking sales).

customerExternalId

Yes

A unique customer identifier from your system. LinkKit uses this value to identify the customer and attribute future events to them.

customerName

No

The customer's name. If omitted, LinkKit may generate a placeholder name automatically.

customerEmail

No

The customer's email address.

customerAvatar

No

A URL pointing to the customer's avatar or profile image.

mode

No

Determines how the lead event is processed. async sends the event without blocking the request, wait waits until the event is fully recorded, and deferred postpones lead creation until a later request.

metadata

No

Additional custom data to store with the lead event. Maximum length: 10,000 characters.

Sale Event Properties

The following properties can be included when sending a sale event to LinkKit:

Property

Required

Description

customerExternalId

Yes

A unique customer identifier from your system. LinkKit uses this value to identify the customer and attribute current and future events.

amount

Yes

The total sale amount, expressed in cents.

paymentProcessor

No

The payment provider used to process the transaction (for example, Stripe or Shopify). Defaults to "custom".

eventName

No

The name of the sale event. Defaults to "Purchase".

invoiceId

No

The invoice or transaction ID associated with the sale. This can be used as an idempotency key, ensuring only one sale event is recorded per invoice ID.

currency

No

The currency used for the transaction. Defaults to "usd".

metadata

No

Additional custom information to store with the sale event.

clickId

No

(Direct sale tracking) The unique click identifier associated with the sale. This value can be retrieved from the linkkit_id cookie.

customerName

No

(Direct sale tracking) The customer's name.

customerEmail

No

(Direct sale tracking) The customer's email address.

customerAvatar

No

(Direct sale tracking) A URL to the customer's avatar or profile image.

View Conversion Results

That's it — you're ready to start tracking and measuring conversions with LinkKit. As conversion data begins to flow in, you can use the available reporting views to analyze performance and gain deeper insights into your funnel.

LinkKit provides multiple reporting views to help you understand your conversion activity:

Time-Series View

Visualize conversion performance over time with a time-series chart that displays:

  • Clicks – The number of tracked link clicks.
  • Leads – The number of lead conversions generated.
  • Sales – The number of completed sales conversions.

This view makes it easy to identify trends, measure growth, and understand how conversions progress throughout your funnel.

Funnel Chart View

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

Clicks → Leads → Sales

This view helps you identify where users are converting successfully and where potential customers are dropping off, making it easier to optimize each step of your funnel and improve overall conversion performance.

Real-Time Events Stream

Monitor 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 instant visibility into:

  • Lead conversions as they occur.
  • Sales conversions in real time.
  • Customer and attribution data associated with each event.
  • Recent activity across all tracked links in a single feed.

It's ideal for monitoring live campaigns, validating tracking setups, and staying up to date with conversion activity as it happens.

Example apps


Was this page helpful?