When initialized in synchronous mode, the .NET SDK sends each event as a single batch. In asynchronous mode, it groups events together and sends them to the backend as a single batch.
Gzipping requests
The Gzip feature is enabled by default in the .NET SDK from version 2.0.0
The .NET SDK automatically gzips requests. However, you can disable this by setting the gzip parameter of RudderConfig to false while initializing the SDK:
Gzip requires rudder-serverv1.4 or higher. Otherwise, your events might fail.
Sending events
RudderStack does not store or persist the user state in any of the server-side SDKs.
Unlike the client-side SDKs that deal with only a single user at a given time, the server-side SDKs deal with multiple users simultaneously. Therefore, you must specify either userId or anonymousId every time while making any API calls supported by the .NET SDK.
Identify
The identify call lets you identify a visiting user and associate them to their actions. It also lets you record the traits about them like their name, email address, etc.
A sample identify call made using the .NET SDK is shown below:
The page method parameters are as described below:
Field
Type
Description
userId Required, if anonymousId is absent.
String
Unique identifier for a user in your database.
name Required
String
Name of the viewed page.
category
String
Category of the viewed page.
properties
Object
An optional dictionary of the properties associated with the viewed page, like url or referrer.
options
Object
Object containing anonymousId, integrations, timestamp, and context.
See the options parameter section for more information on the options object and its fields.
Screen
The screen call is the mobile equivalent of the page call. It allows you to record the screen views on your mobile app along with the other relevant information about the app screen.
The screen method parameters are as described below:
Field
Type
Description
userId Required, if anonymousId is absent.
String
Unique identifier for a user in your database.
name Required
String
Name of the viewed screen.
category
String
Category of the viewed screen.
properties
Object
An optional dictionary of the properties associated with the viewed screen, like url or referrer.
options
Object
Object containing anonymousId, integrations, timestamp, and context.
See the options parameter section for more information on the options object and its fields.
Group
The group call lets you link an identified user with a group, such as a company, organization, or an account. It also lets you record any custom traits or properties associated with that group.
A sample group call made using the .NET SDK is shown below:
An optional dictionary of the group’s traits like nameor email.
options
Object
Object containing anonymousId, integrations, timestamp, and context.
See the options parameter section for more information on the options object and its fields.
Alias
The alias call lets you merge different identities of a known user. It is an advanced method that lets you change the tracked user’s ID explicitly. You can use alias for managing the user’s identity in some of the downstream destinations.
RudderStack supports sending alias events only to select downstream destinations. Refer to the destination-specific documentation for more details.
The logger must be on a minimum version of .NET Core 2.1.
FAQ
How does the .NET SDK handle events larger than 32KB?
If you are running the .NET SDK asynchronously, RudderStack drops any events greater than 32KB.
For synchronous initialization, the SDK accepts and sends each event greater than 32KB as a single batch and sends them to the RudderStack data plane (backend).
Does the .NET SDK support event ordering?
The .NET SDK does not support event ordering by default.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
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 Cookie Settings.