Skip to content

Commit 9f394a4

Browse files
committed
update integration guide
1 parent 96f9a2e commit 9f394a4

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ To get started with the Analytics-CSharp library:
3232
3. Initialize and configure the client.
3333
3434
```c#
35-
// NOTE: persistentDataPath is different on different platform
36-
// for Xamarin use: Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
37-
// for Unity use: Application.persistentDataPath
35+
// NOTE: to make Analytics stateless/in-memory,
36+
// add `InMemoryStorageProvider` to the configuration
3837
var configuration = new Configuration("<YOUR WRITE KEY>",
39-
persistentDataPath: "<PATH TO STORE DATA>",
4038
flushAt: 1,
4139
flushInterval: 10);
4240
var analytics = new Analytics(configuration);
@@ -135,11 +133,11 @@ For example, if you want to add something to the context object of any event pay
135133
```c#
136134
class SomePlugin : Plugin
137135
{
138-
public override PluginType type => PluginType.Enrichment;
136+
public override PluginType Type => PluginType.Enrichment;
139137

140138
public override RawEvent Execute(RawEvent incomingEvent)
141139
{
142-
incomingEvent.context["foo"] = "bar";
140+
incomingEvent.Context["foo"] = "bar";
143141
return incomingEvent;
144142
}
145143
}
@@ -153,7 +151,7 @@ For example, if you only want to act on `track` & `identify` events:
153151
```c#
154152
class SomePlugin : EventPlugin
155153
{
156-
public override PluginType type => PluginType.Enrichment;
154+
public override PluginType Type => PluginType.Enrichment;
157155

158156
public override IdentifyEvent Identify(IdentifyEvent identifyEvent)
159157
{
@@ -177,7 +175,7 @@ For example, if you want to implement a device-mode destination plugin for Ampli
177175
```c#
178176
class AmplitudePlugin : DestinationPlugin
179177
{
180-
public override string key =>
178+
public override string Key =>
181179
"Amplitude"; // This is the name of the destination plugin, it is used to retrieve settings internally
182180
183181
private Amplitude amplitudeSDK: // This is an instance of the partner SDK
@@ -194,7 +192,7 @@ class AmplitudePlugin : DestinationPlugin
194192
*/
195193
public override TrackEvent Track(TrackEvent trackEvent)
196194
{
197-
amplitudeSDK.logEvent(trackEvent.@event);
195+
amplitudeSDK.logEvent(trackEvent.Event);
198196
return trackEvent;
199197
}
200198
}
@@ -209,11 +207,11 @@ class AmplitudePlugin : DestinationPlugin
209207
```c#
210208
class AmplitudeEnrichment : Plugin
211209
{
212-
public override PluginType type => PluginType.Enrichment;
210+
public override PluginType Type => PluginType.Enrichment;
213211

214212
public override RawEvent Execute(RawEvent incomingEvent)
215213
{
216-
incomingEvent.context["foo"] = "bar";
214+
incomingEvent.Context["foo"] = "bar";
217215
return incomingEvent;
218216
}
219217
}
@@ -239,11 +237,11 @@ Here's an example of adding a plugin to the context object of any event payload
239237
```c#
240238
class SomePlugin : Plugin
241239
{
242-
public override PluginType type => PluginType.Enrichment;
240+
public override PluginType Type => PluginType.Enrichment;
243241

244242
public override RawEvent Execute(RawEvent incomingEvent)
245243
{
246-
incomingEvent.context["foo"] = "bar";
244+
incomingEvent.Context["foo"] = "bar";
247245
return incomingEvent;
248246
}
249247
}
@@ -270,11 +268,11 @@ The Add method lets you add a plugin to the analytics timeline.
270268
```c#
271269
class SomePlugin : Plugin
272270
{
273-
public override PluginType type => PluginType.Enrichment;
271+
public override PluginType Type => PluginType.Enrichment;
274272

275273
public override RawEvent Execute(RawEvent incomingEvent)
276274
{
277-
incomingEvent.context["foo"] = "bar";
275+
incomingEvent.Context["foo"] = "bar";
278276
return incomingEvent;
279277
}
280278
}

0 commit comments

Comments
 (0)