Webflow Segment Implementation

How to properly configure a Webflow website to use Segment for tracking management.

  • Load Segment's Analytics.js once at the site level (Site settings > Custom code > Head), keep analytics.page() at the end of the snippet, and remove any GA4, Meta or LinkedIn scripts previously pasted into Webflow to avoid double counting.
  • Webflow Analyze and Optimize don't read Segment data. Conversions must be passed separately to Webflow's Browser API using wf.sendEvent() and wf.setUserId().
  • Segment and Webflow have different rules: Webflow events must be 40 printable ASCII characters or fewer with no spaces and are case sensitive, values can't be negative or include currency symbols, all wf calls must run inside wf.ready(), and no personal information may be used in the userId.
  • For on-site conversions, create each custom goal in Webflow first, then add one Footer script that listens to Segment's track events and forwards matching ones to wf.sendEvent(). The conversion shows in Analyze and Optimize in about 15 to 30 minutes.
  • For off-site conversions (e.g., CRM deals closing), call wf.setUserId(userDomain, userId) while the visitor is still on the site, using a non-personal ID or SHA-256 hash. Then report the conversion from your server to Webflow's server-side API with the same userDomain and userId.
  • Off-site conversion limits: the actionTimestamp can't be in the future or older than 2 days, the conversion must fall within the same session (30 minutes of inactivity or 24 hours max) to be credited to an Optimize variation, and imports run nightly at midnight UTC.
  • A helper function that calls analytics.identify() and wf.setUserId() together keeps Segment and Webflow identities in sync. Email and name can go to Segment as traits, but only the ID goes to Webflow.
  • Use a separate Segment source and write key for the webflow.io staging domain, and make your cookie banner control consent for both Segment and Webflow.
  • Verify the setup with Segment's source debugger (one page call, one track call per event, no console errors), check goals in Webflow Analyze after 30 minutes, check off-site goals the next day, and avoid duplicate server-side events by reading up on deduplication.

Segment gives a Webflow site a single place to manage tracking across every analytics and ad platform.

If you want to set it up properly, load Segment once, send every event through it, and pass the conversions Webflow needs into Webflow’s own Browser API. Webflow Analyze and Optimize don’t read Segment data, so that last part is the one most setups miss.

How the Pieces Fit

Layer What It Does
Segment (Analytics.js) Collects page views, track and identify calls. Loaded once, site wide.
Segment destinations Send that data to GA4, ad platforms, the CRM and the warehouse. No vendor scripts pasted into Webflow.
Webflow Browser API (wf) Records custom goals for Analyze and Optimize with wf.sendEvent() and wf.setUserId().

Install Segment in Webflow

  1. In Segment, create a JavaScript website source and copy its Analytics.js snippet.
  2. In Webflow, open Site settings > Custom code.
  3. Paste the snippet into Head code, save and publish.

A few rules I follow:

  • Add the snippet once, at the site level. Don’t paste it again into a page’s custom code.
  • Keep the analytics.page() call at the end of the snippet. Many destinations need it.
  • Remove the GA4, Meta and LinkedIn scripts that were pasted into Webflow before. Those now come from Segment, and leaving both in place double counts.
  • Use a separate source, with its own write key, for the webflow.io staging domain.

Segment & Webflow Naming Rules

The two APIs have different rules, so you can’t pass Segment values straight through:

Segment Webflow
Loading Calls queue as soon as the snippet runs Every call goes inside wf.ready()
Event name Usually words with spaces, like Demo Requested 40 printable ASCII characters or fewer, no spaces, case sensitive
Value revenue or value property Not negative, up to two decimals, no currency symbol
User ID Traits can include email and name No personal information in the userId

Example: On-Site Conversions With sendEvent

Create each custom goal in Webflow first. wf.sendEvent() only records a conversion when the event name matches the goal exactly.

Then, rather than adding wf.sendEvent() next to every analytics.track() call, listen for Segment’s track events and forward the ones that are goals. This goes in Footer code:

<script>
(function () {
  // Segment event name: Webflow custom goal event name
  var goals = {
    'Demo Requested': 'demo_requested',
    'Newsletter Subscribed': 'newsletter_subscribed',
    'Order Completed': 'purchase'
  };

  if (!window.analytics) {
    return;
  }

  analytics.on('track', function (event, properties) {
    var goal = goals[event];
    if (!goal || !window.wf) {
      return;
    }
    var props = properties || {};
    var value = Number.parseFloat(props.revenue != null ? props.revenue : props.value);

    wf.ready(function () {
      if (value >= 0) {
        wf.sendEvent(goal, { value: value.toFixed(2) });
      } else {
        wf.sendEvent(goal);
      }
    });
  });
})();
</script>

Now one call does both jobs:

analytics.track('Order Completed', {
  order_id: 'ord_98412',
  revenue: 149.99,
  currency: 'USD'
});

Segment sends it to every destination, and Webflow records a purchase goal worth 149.99. On-site conversions show up in Analyze and Optimize in about 15 to 30 minutes.

Example: Off-Site Conversions With setUserId

Some conversions happen after the visitor leaves the site: an application is approved, a deal closes in Salesforce, an account is upgraded in the app. For Webflow to credit those, you have to tell it who the visitor is while they’re still on the site, with wf.setUserId(userDomain, userId).

  • userDomain is a label for the system the ID comes from, like salesforce or applicationId.
  • userId is the ID in that system. It has to match what your server sends later.
  • No names, emails or phone numbers. Use a database or CRM ID, or a SHA-256 hash.
  • The ID lasts for the session, which ends after 30 minutes of inactivity or 24 hours at most.

I use one helper so Segment and Webflow are always identified together:

window.identifyVisitor = function (userDomain, userId, traits) {
  analytics.identify(userId, traits || {});

  if (window.wf) {
    wf.ready(function () {
      wf.setUserId(userDomain, String(userId));
    });
  }
};

// After a form or login returns an ID
identifyVisitor('applicationId', '123456789', { plan: 'enterprise' });

Email and name can still go to Segment as traits. Only the ID goes to Webflow.

Sending the Off-Site Conversion

When the conversion happens, your server reports it to Webflow’s server-side API with the same userDomain and userId:

curl --request POST 'https://log.intellimize.co/event' \
  --header 'Authorization: ApiKey YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "customerId": "your-account-id",
    "eventName": "application_accepted",
    "userDomain": "applicationId",
    "userId": "123456789",
    "actionId": "unique-conversion-id",
    "actionTimestamp": 1653514258136,
    "value": 149.99
  }'
  • The token is created in Webflow under Insights > Tracking Settings.
  • actionTimestamp is UTC, in UNIX milliseconds. It can’t be in the future or more than 2 days old.
  • The custom goal has to exist before the conversion happens.
  • The conversion has to fall inside the same session as the visit to be credited to an Optimize variation.
  • Off-site conversions import nightly at midnight UTC, so today’s won’t appear until tomorrow.

If the conversion already passes through Segment as a server-side event, a Segment destination function or webhook can make this request, so the CRM doesn’t need its own integration.

Segment and Webflow keep their own consent state. Your cookie banner has to control both, or one keeps tracking after a visitor declines. The same applies to the banner setup I cover in GTM Consent Mode V2 for Webflow.

Check It

  1. Open the Segment source debugger, load a page and confirm one page call.
  2. Trigger each mapped event and confirm one track call in Segment and no console errors.
  3. Wait 30 minutes and confirm the goal in Webflow Analyze.
  4. Run the identify flow, send a test request with curl, and check the off-site goal the next day.

If the same conversion is also sent from a server, read server-side tracking event deduplication before turning both on.