@@ -32,11 +32,9 @@ To get started with the Analytics-CSharp library:
32
32
3. Initialize and configure the client.
33
33
34
34
```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
38
37
var configuration = new Configuration("<YOUR WRITE KEY>",
39
- persistentDataPath: "<PATH TO STORE DATA>",
40
38
flushAt: 1,
41
39
flushInterval: 10);
42
40
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
135
133
``` c#
136
134
class SomePlugin : Plugin
137
135
{
138
- public override PluginType type => PluginType .Enrichment ;
136
+ public override PluginType Type => PluginType .Enrichment ;
139
137
140
138
public override RawEvent Execute (RawEvent incomingEvent )
141
139
{
142
- incomingEvent .context [" foo" ] = " bar" ;
140
+ incomingEvent .Context [" foo" ] = " bar" ;
143
141
return incomingEvent ;
144
142
}
145
143
}
@@ -153,7 +151,7 @@ For example, if you only want to act on `track` & `identify` events:
153
151
``` c#
154
152
class SomePlugin : EventPlugin
155
153
{
156
- public override PluginType type => PluginType .Enrichment ;
154
+ public override PluginType Type => PluginType .Enrichment ;
157
155
158
156
public override IdentifyEvent Identify (IdentifyEvent identifyEvent )
159
157
{
@@ -177,7 +175,7 @@ For example, if you want to implement a device-mode destination plugin for Ampli
177
175
``` c#
178
176
class AmplitudePlugin : DestinationPlugin
179
177
{
180
- public override string key =>
178
+ public override string Key =>
181
179
" Amplitude" ; // This is the name of the destination plugin, it is used to retrieve settings internally
182
180
183
181
private Amplitude amplitudeSDK: // This is an instance of the partner SDK
@@ -194,7 +192,7 @@ class AmplitudePlugin : DestinationPlugin
194
192
*/
195
193
public override TrackEvent Track (TrackEvent trackEvent )
196
194
{
197
- amplitudeSDK .logEvent (trackEvent .@event );
195
+ amplitudeSDK .logEvent (trackEvent .Event );
198
196
return trackEvent ;
199
197
}
200
198
}
@@ -209,11 +207,11 @@ class AmplitudePlugin : DestinationPlugin
209
207
``` c#
210
208
class AmplitudeEnrichment : Plugin
211
209
{
212
- public override PluginType type => PluginType .Enrichment ;
210
+ public override PluginType Type => PluginType .Enrichment ;
213
211
214
212
public override RawEvent Execute (RawEvent incomingEvent )
215
213
{
216
- incomingEvent .context [" foo" ] = " bar" ;
214
+ incomingEvent .Context [" foo" ] = " bar" ;
217
215
return incomingEvent ;
218
216
}
219
217
}
@@ -239,11 +237,11 @@ Here's an example of adding a plugin to the context object of any event payload
239
237
```c #
240
238
class SomePlugin : Plugin
241
239
{
242
- public override PluginType type => PluginType .Enrichment ;
240
+ public override PluginType Type => PluginType .Enrichment ;
243
241
244
242
public override RawEvent Execute (RawEvent incomingEvent )
245
243
{
246
- incomingEvent .context [" foo" ] = " bar" ;
244
+ incomingEvent .Context [" foo" ] = " bar" ;
247
245
return incomingEvent ;
248
246
}
249
247
}
@@ -270,11 +268,11 @@ The Add method lets you add a plugin to the analytics timeline.
270
268
```c #
271
269
class SomePlugin : Plugin
272
270
{
273
- public override PluginType type => PluginType .Enrichment ;
271
+ public override PluginType Type => PluginType .Enrichment ;
274
272
275
273
public override RawEvent Execute (RawEvent incomingEvent )
276
274
{
277
- incomingEvent .context [" foo" ] = " bar" ;
275
+ incomingEvent .Context [" foo" ] = " bar" ;
278
276
return incomingEvent ;
279
277
}
280
278
}
0 commit comments