Collector

Segment Integration

OpenSnowcat Collector allows the use of Segment Analytics.js 2.0 with OpenSnowcat data pipeline

OpenSnowcat Pipeline

2-minute demo video of OpenSnowcat's Segment integration.

The OpenSnowcat Collector can receive events straight from Segment Analytics.js 2.0 Spec. Just change the endpoint to your OpenSnowcat collector.

The OpenSnowcat Segment integration enables you to use Segment Analytics.js 2.0 API calls with your OpenSnowcat pipeline. This could help facilitate migrations from Segment. Segment events are self-describing Snowplow events.

Supported API Calls

OpenSnowcat supports all the main Segment Analytics.js 2.0 API calls.

Segment Configuration

In order to send events to your OpenSnowcat collector using Segment SDK you'll need to add extra options to the analytics.load function in your Segment snippet.

  1. Add apiHost and apiPath to your Segment snippet under analytics.load like the example below.
Segment snippet
analytics.load("<< YOUR KEY >>", { 
         integrations: { 
             "Segment.io": {  // Do not change! apiHost will revert to api.segment.io
                 apiHost: "<< OPENSNOWCAT COLLECTOR FQDN >>/com.segment/v1" }
             }
         }
);

OpenSnowcat Configuration

  1. Configure your OpenSnowcat collector to support Segment Analytics JS (See full config examples on OpenSnowcat's Github)
Collector config
experimental {
 enableAnalyticsJsBridge = true
}
  1. Install Segment Schemas

IMPORTANT We submitted a PR to Snowplow Iglu Central to included the necessary Segment schemas, if you would like to use this integration please install all the Segment schemas in your IGLU repository.

Event Data in OpenSnowcat

Segment events are passed into Snowplow as self-describing events with event_vendor:com.segment and event_name: name of api called.

Below is an event as recorded by OpenSnowcat.

OpenSnowcat partial event
  ...
  "v_tracker": "next-1.70.0",
  "os_timezone": "en-US",
  "br_type": null,
  "br_features_windowsmedia": null,
  "event_version": "1-0-0",
  "unstruct_event_com_segment_track_1": {
      "timestamp": "2024-08-18T17:20:31.696Z",
      "integrations": {},
      "event": "user registered",
      "type": "track",
      "properties": {},
      "context": {
          "page": {
              "path": "/",
              "referrer": "",
              "search": "",
              "title": "Customer Data Infrastructure",
              "url": "https://www.snowcatcloud.com"
          },
          "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
          "userAgentData": {
              "brands": [
                  {
                      "brand": "Not)A;Brand",
                      "version": "99"
                  },
                  {
                      "brand": "Google Chrome",
                      "version": "127"
                  },
                  {
                      "brand": "Chromium",
                      "version": "127"
                  }
              ],
              "mobile": false,
              "platform": "macOS"
          },
          "locale": "en-US",
          "library": {
              "name": "analytics.js",
              "version": "next-1.70.0"
          },
          "timezone": "Europe/Madrid"
      },
      "messageId": "81ad0ad4-fd9f-4af0-a3fb-180ef2c3c611",
      "anonymousId": "ffff835f-3b49-4122-948c-a895174fd311",
      "writeKey": "rWAfVSHRrcvxG0UH4vv3aFZ2dIPmv08c",
      "userId": "1234",
      "sentAt": "2024-08-18T17:20:31.703Z",
      "_metadata": {
          "bundled": [
              "Segment.io"
          ],
          "unbundled": [],
          "bundledIds": []
      }
  },
  "dvce_screenwidth": null,
  "refr_dvce_tstamp": null,
  "se_label": null,
  "domain_sessionid": null,
  "domain_userid": null,
  ...