Migrating from Snowplow to RudderStack

Step-by-step guide on migrating from Snowplow to RudderStack.

This document covers the necessary steps to migrate from Snowplow to RudderStack and replace your instrumentation code. You can then start using the RudderStack SDKs to track your events with minimal code changes.

Github Badge

Setting up RudderStack dashboard

  1. Sign up for RudderStack Cloud.
  2. Set up the source-destination connections in the dashboard to facilitate the event data flow. For more information on setting up the connections, refer to the Quickstart guide.
Note the source write key and the data plane URL as they will be used in the next section.

Updating the SDK implementation

Depending on the platform, follow these steps to move your existing Snowplow SDK implementation to RudderStack:

Follow the below steps to migrate to the RudderStack Android SDK:
RudderStack distributes the Rudder Snowplow adapter SDK through Maven Central. It is recommended to add the SDK to your project through the Android Gradle build system.
  1. Add the following lines of code in your project level app/build.gradle file:
    buildscript {
    repositories {
    mavenCentral()
    }
    }
    allprojects {
    repositories {
    mavenCentral()
    }
    }
  2. Add the following dependency under dependencies section in your app/build.gradle file:
    implementation 'com.rudderstack.android.snowplow:adapter:1.0.0.beta.1'
  3. Update your SDK initialization to any one of the following snippet (method 1, 2, or 3 in the below snippets). Also, replace the WRITE_KEY and DATA_PLANE_URL with your source write key and data plane URL obtained in the above section.
    //Method 1: Default values are considered for all the configuration objects
    //except networkConfiguration.
    RSTracker tracker = new RSTracker()
    .createTracker(
    this, WRITE_KEY, networkConfiguration
    );
    //Method 2: Default values are considered for all the configuration objects.
    RSTracker tracker = new RSTracker()
    .createTracker(
    this, WRITE_KEY, DATA_PLANE_URL
    );
    //Method 3: Values for all the configuration objects must be provided.
    RSTracker tracker = new RSTracker()
    .createTracker(
    this, WRITE_KEY, networkConfiguration,
    sessionConfiguration, trackerConfiguration,
    subjectConfiguration
    );
Refer to the Setting the configuration objects section for more information on using these configuration objects.

Setting the configuration objects for mobile SDKs

RudderStack supports setting values for the following Snowplow configuration objects in the mobile SDKs (iOS/Android). If not set, the default values are assigned.

NetworkConfiguration

The NetworkConfiguration class can be used to specify the collector endpoint, as shown:

// 1
RSNetworkConfiguration *networkConfig = [[RSNetworkConfiguration alloc] initWithDataPlaneUrl:DATA_PLANE_URL];
// 2
RSNetworkConfiguration *networkConfig = [[RSNetworkConfiguration alloc] initWithDataPlaneUrl:DATA_PLANE_URL controlPlaneUrl:CONTROL_PLANE_URL];
If not set, the default values for dataPlaneUrl and controlPlaneUrl are taken as https://hosted.rudderlabs.com and https://api.rudderlabs.com respectively.

SessionConfiguration

The SessionConfiguration class can be used to capture sessions to track the user activity in the app, as shown:

RSSessionConfiguration *sessionConfig = [[RSSessionConfiguration alloc] initWithForegroundTimeout:[[NSMeasurement alloc] initWithDoubleValue:30 unit:NSUnitDuration.minutes] backgroundTimeout:[[NSMeasurement alloc] initWithDoubleValue:30 unit:NSUnitDuration.minutes]];
// 2
RSSessionConfiguration *sessionConfig = [[RSSessionConfiguration alloc] initWithForegroundTimeoutInSeconds:60 backgroundTimeoutInSeconds:60];
You need to pass both the arguments for SessionConfiguration class as shown in the above code snippets. However, RudderStack ignores the first argument (as it is a dummy argument) and considers only the second argument (backgroundTimeout).
For mobile SDKs, Snowplow's default timeout session is 30 minutes whereas RudderStack's default timeout session is 5 minutes. Refer to the RudderStack Session Tracking documentation for more information.

TrackerConfiguration

The TrackerConfiguration class can be used to configure contexts and automatic events of the tracker and the general behavior, as shown in the below snippets:

RSTrackerConfiguration * trackerConfig = [
[RSTrackerConfiguration alloc] init
];
[trackerConfig base64Encoding: YES];
[trackerConfig logLevel: LogLevelDebug];
[trackerConfig sessionContext: YES];
[trackerConfig deepLinkContext: YES];
[trackerConfig applicationContext: YES];
[trackerConfig platformContext: YES];
[trackerConfig geoLocationContext: NO];
[trackerConfig screenContext: YES];
[trackerConfig screenViewAutotracking: YES];
[trackerConfig lifecycleAutotracking: YES];
[trackerConfig installAutotracking: YES];
[trackerConfig exceptionAutotracking: YES];
[trackerConfig diagnosticAutotracking: NO];
[trackerConfig userAnonymisation: NO];
[trackerConfig appId: APP_ID];

Snowplow automatically captures and tracks the following data. Refer to the Auto-tracked events and entities section for more information.

Variable nameDefault value
logLevelLogLevel.OFF
lifecycleAutotrackingtrue
screenViewAutotrackingtrue
sessionContexttrue
RudderStack ignores any variable other than the ones mentioned above.

SubjectConfiguration

The SubjectConfiguration class can be used to capture basic user information which is attached to all the events as the context entity.

Snowplow does not provide any call to identify a user. However, RudderStack sends an identify call if you initialize the SubjectConfiguration class while initializing the SDK. Note that a user is not identified if the SDK is not initialized.

The userId field is mapped to the RudderStack's userId. All the other properties are mapped to RudderStack's traits object.

userId is a mandatory field. If not provided, the identify call is ignored.
RSSubjectConfiguration * subjectConfig = [
[RSSubjectConfiguration alloc] init
];
[subjectConfig userId: @ "user_id"];
[subjectConfig traits: @ {
@ "key_1": @ "value_1", @ "key_2": @20, @ "key_3": @YES
}];

Updating class names

The below table lists the corresponding class names in Snowplow and RudderStack (mobile SDKs) which need to be updated based on your platform:

SnowplowRudderStack
JavaKotlinObjective-CSwift
NetworkConfigurationNetworkConfigurationNetworkConfigurationRSNetworkConfigurationNetworkConfiguration
TrackerConfigurationTrackerConfigurationTrackerConfigurationRSTrackerConfigurationTrackerConfiguration
SessionConfigurationSessionConfigurationSessionConfigurationRSSessionConfigurationSessionConfiguration
SubjectConfigurationSubjectConfigurationSubjectConfigurationRSSubjectConfigurationSubjectConfiguration
StructuredStructuredStructuredRSStructuredStructured
ScreenViewScreenViewScreenViewRSScreenViewScreenView
BackgroundBackgroundBackgroundRSBackgroundBackground
ForegroundForegroundForegroundRSForegroundForeground
SelfDescribingSelfDescribingSelfDescribingRSSelfDescribingSelfDescribing
SelfDescribingJsonSelfDescribingJsonSelfDescribingJsonRSSelfDescribingJsonSelfDescribingJson
TimeMeasureTimeMeasureTimeMeasureN/AN/A
SnowplowRSTrackerRSTrackerRSTrackerRSTracker
LogLevelLogLevelLogLevelLogLevelLogLevel

Sending event data

You can migrate your existing events from Snowplow to RudderStack by following the below sections:

Identifying a user

Snowplow's SubjectConfiguration class can be used to identify the users. Refer to the Setting the configuration objects section for more information.

Tracking user actions

RudderStack SDKs support the following types of Snowplow events:

Custom structured events

RudderStack sends a track call for the Snowplow events containing the Structured class.

In the below example, RudderStack maps Action_example to the RudderStack event name and the rest of the properties like Category_example, label, value, etc. to the RudderStack properties.

RSStructured * structured = [
[RSStructured alloc] initWithCategory: @ "Category_example"
action: @ "Action_example"
];
[structured label: @ "my-label"];
[structured property: @ "my-property"];
[structured value: @5];
[structured properties: @ {
@ "key_1": @ "value_1", @ "key_2": @ "value_2"
}];
[tracker track: structured];

Custom self described events

RudderStack sends a track call for the Snowplow events containing the SelfDescribing class.

In the below example, RudderStack maps action to the RudderStack event name.

// 1
RSSelfDescribingJson * selfDescribingJson = [
[RSSelfDescribingJson alloc] initWithSchema: @ "schema"
andDictionary: @ {
@ "action": @ "Action_2", @ "key_2": @ "value_2"
}
];
RSSelfDescribing * selfDescribing = [
[RSSelfDescribing alloc] initWithEventData: selfDescribingJson
];
// 2
RSSelfDescribing * selfDescribing = [
[RSSelfDescribing alloc] initWithSchema: @ "schema"
payload: @ {
@ "action": @ "Action_2", @ "key_2": @ "value_2"
}
];
[tracker track: selfDescribing];
action is a mandatory field. RudderStack does not send any call if it is absent.

Custom foreground events

RudderStack sends a track call for the Snowplow events containing the Foreground class.

RudderStack sends the event name as Application Opened and maps the rest of the properties like index, properties, etc. to the RudderStack properties.

RSForeground * foreground = [
[RSForeground alloc] initWithIndex: @1
];
[foreground properties: @ {
@ "key_1": @ "value_1"
}];
[tracker track: foreground];
This is not a default application lifecycle event. Hence, the properties like version, build, etc. are not present under properties.

Custom background events

RudderStack sends a track call for the Snowplow events containing the Background class.

RudderStack sends the event name as Application Backgrounded and maps the rest of the properties, like index, properties, etc. to the RudderStack properties.

RSBackground * background = [
[RSBackground alloc] initWithIndex: @1
];
[background properties: @ {
@ "key_1": @ "value_1"
}];
[tracker track: background];
This is not a default application lifecycle event. Hence, the properties like version, build, etc. are not present under properties.

Tracking page or screen views

Snowplow's ScreenView class captures whenever a new screen is loaded. A Snowplow event including the ScreenView class triggers the screen call in the RudderStack iOS/Android SDK.

RudderStack maps the name property to RudderStack event name and the rest of the properties, like screenId, previousName, previousId, etc. to the RudderStack properties.
RSScreenView * screen = [
[RSScreenView alloc] initWithName: @ "DemoScreenName"
screenId: [
[NSUUID alloc] init
]
];
[screen type: @ "type"];
[screen previousName: @ "previousName"];
[screen previousId: @ "previousId"];
[screen previousType: @ "previousType"];
[screen transitionType: @ "transitionType"];
[screen viewControllerClassName: @ "viewControllerClassName"];
[screen topViewControllerClassName: @ "topViewControllerClassName"];
[screen properties: @ {
@ "key_1": @ "value_1",
@ "key_2": @ "value_2"
}];
[tracker track: screen];

Contact us

For more information on the topics covered on this page, email us or start a conversation in our Slack community.

This site uses cookies to improve your experience. If you want to learn more about cookies and why we use them, visit our cookie policy.  We'll assume you're ok with this, but you can opt-out if you wish