Skip to content

Commit 20c97d8

Browse files
committed
update migration guide
1 parent 0d341b6 commit 20c97d8

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/connections/sources/catalog/libraries/server/csharp/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ These platforms support Analytics-CSharp:
2727
## Getting started
2828

2929
> info ""
30-
> If you'd like to migrate to Analytics-CSharp from a different library, follow the steps in the [Analytics-CSharp migration guide](/docs/connections/sources/catalog/libraries/server/csharp/migration-guide/).
30+
> If you'd like to migrate to Analytics-CSharp from Analytics.NET or Analytics.Xamarin, follow the steps in the [Analytics-CSharp migration guide](/docs/connections/sources/catalog/libraries/server/csharp/migration-guide/).
3131
3232
To get started with the Analytics-CSharp library:
3333

src/connections/sources/catalog/libraries/server/csharp/migration-guide.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you’re currently using Analytics.NET or Analytics.Xamarin to send data to S
88
You can update to Analytics-CSharp in 3 easy steps
99
1. Bundle Analytics-CSharp into your app (and remove your previous SDK)
1010
2. Change the namespaces
11-
3. Advanced: Run Analytics in Synchronous Mode
11+
3. (Optional) Use `Reset` to stay anonymous
1212

1313

1414
## Start the Migration
@@ -46,33 +46,33 @@ You can update to Analytics-CSharp in 3 easy steps
4646
using Segment.Analytics.Compat;
4747
```
4848

49-
## Optional Changes
50-
51-
1. Change your development settings if you would like to make analytics run synchronously for testing purposes.
49+
3. (Optional) Update calls that resets anonymous ID.
50+
51+
The old SDK requires you to provide anouymous ID. In the new SDK, it generates an Anonymous ID for you if you never call `analytics.Identify`. If you've called `Identify` and want to go back to anonymous, the new SDK provides a `Reset` function to acheive that.
5252
5353
<br> Before:
5454
```c#
55-
Analytics.Initialize("YOUR_WRITE_KEY", new Config().SetAsync(false));
55+
Analytics.Client.Page(null, "Login", new Properties(), new Options()
56+
.SetAnonymousId("some-id"));
5657
```
5758
5859
<br> After:
5960
```c#
60-
var configuration = new Configuration("YOUR WRITE KEY",
61-
useSynchronizeDispatcher: true);
62-
var analytics = new Analytics(configuration);
61+
analytics.Reset();
6362
```
6463
65-
2. Review your anonymous ID settings.
64+
## Optional Changes for Unit Tests
65+
66+
1. Change your development settings if you would like to make analytics run synchronously for testing purposes.
6667
6768
<br> Before:
6869
```c#
69-
Analytics.Client.Page(null, "Login", new Properties(), new Options()
70-
.SetAnonymousId("some-id"));
70+
Analytics.Initialize("YOUR_WRITE_KEY", new Config().SetAsync(false));
7171
```
7272
73-
The new SDK by default, generates an Anonymous ID for you if you never call `analytics.Identify`. If you've called `Identify` and want to go back to anonymous, try:
74-
7573
<br> After:
7674
```c#
77-
analytics.Reset();
75+
var configuration = new Configuration("YOUR WRITE KEY",
76+
useSynchronizeDispatcher: true);
77+
var analytics = new Analytics(configuration);
7878
```

0 commit comments

Comments
 (0)