@flisk/analyze-tracking 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,11 +38,20 @@ npx @flisk/analyze-tracking /path/to/project [options]
38
38
  Use this if you have your own in-house tracker or a wrapper function that calls other tracking libraries.
39
39
 
40
40
  We currently only support functions that follow the following format:
41
+
42
+ **JavaScript/TypeScript/Python/Ruby:**
41
43
  ```js
42
44
  yourCustomTrackFunctionName('<event_name>', {
43
45
  <event_parameters>
44
46
  });
45
47
  ```
48
+
49
+ **Go:**
50
+ ```go
51
+ yourCustomTrackFunctionName("<event_name>", map[string]any{}{
52
+ "<property_name>": "<property_value>",
53
+ })
54
+ ```
46
55
  </details>
47
56
 
48
57
 
@@ -76,23 +85,25 @@ Use this to understand where your events live in the code and how they're being
76
85
  Your LLM of choice is used for generating descriptions of events, properties, and implementations.
77
86
 
78
87
  See [schema.json](schema.json) for a JSON Schema of the output.
79
-
88
+
80
89
 
81
90
  ## Supported tracking libraries & languages
82
91
 
83
- | Library | JavaScript/TypeScript | Python | Ruby |
84
- |---------|:---------------------:|:------:|:----:|
85
- | Google Analytics | ✅ | ❌ | ❌ |
86
- | Segment | ✅ | ✅ | ✅ |
87
- | Mixpanel | ✅ | ✅ | ✅ |
88
- | Amplitude | ✅ | ✅ | ❌ |
89
- | Rudderstack | ✅ | ✅ | |
90
- | mParticle | ✅ | ✅ | ❌ |
91
- | PostHog | ✅ | ✅ | ✅ |
92
- | Pendo | ✅ | ✅ | ❌ |
93
- | Heap | ✅ | ✅ | ❌ |
94
- | Snowplow | ✅ | ✅ | ✅ |
95
- | Custom Function | ✅ | ✅ | ✅ |
92
+ | Library | JavaScript/TypeScript | Python | Ruby | Go |
93
+ |---------|:---------------------:|:------:|:----:|:--:|
94
+ | Google Analytics | ✅ | ❌ | ❌ | ❌ |
95
+ | Segment | | ✅ | ✅ | ✅ |
96
+ | Mixpanel | | ✅ | ✅ | ✅ |
97
+ | Amplitude | ✅ | ✅ | ❌ | ✅ |
98
+ | Rudderstack | ✅ | ✅ | ✳️ | ✳️ |
99
+ | mParticle | ✅ | ✅ | ❌ | ❌ |
100
+ | PostHog | | ✅ | ✅ | ✅ |
101
+ | Pendo | ✅ | ✅ | ❌ | ❌ |
102
+ | Heap | ✅ | ✅ | ❌ | ❌ |
103
+ | Snowplow | | ✅ | ✅ | ✅ |
104
+ | Custom Function | | ✅ | ✅ | ✅ |
105
+
106
+ ✳️ Rudderstack's SDKs often use the same format as Segment, so Rudderstack events may be detected as Segment events.
96
107
 
97
108
 
98
109
  ## SDKs for supported libraries
@@ -103,7 +114,7 @@ See [schema.json](schema.json) for a JSON Schema of the output.
103
114
  **JavaScript/TypeScript**
104
115
  ```js
105
116
  gtag('event', '<event_name>', {
106
- <event_parameters>
117
+ '<property_name>': '<property_value>'
107
118
  });
108
119
  ```
109
120
  </details>
@@ -114,7 +125,7 @@ See [schema.json](schema.json) for a JSON Schema of the output.
114
125
  **JavaScript/TypeScript**
115
126
  ```js
116
127
  analytics.track('<event_name>', {
117
- <event_parameters>
128
+ '<property_name>': '<property_value>'
118
129
  });
119
130
  ```
120
131
 
@@ -130,10 +141,20 @@ See [schema.json](schema.json) for a JSON Schema of the output.
130
141
  Analytics.track(
131
142
  event: '<event_name>',
132
143
  properties: {
133
- <event_parameters>
144
+ '<property_name>': '<property_value>'
134
145
  }
135
146
  )
136
147
  ```
148
+
149
+ **Go**
150
+ ```go
151
+ client.Enqueue(analytics.Track{
152
+ UserId: "user-id",
153
+ Event: "<event_name>",
154
+ Properties: analytics.NewProperties().
155
+ Set("<property_name>", "<property_value>"),
156
+ })
157
+ ```
137
158
  </details>
138
159
 
139
160
  <details>
@@ -142,7 +163,7 @@ See [schema.json](schema.json) for a JSON Schema of the output.
142
163
  **JavaScript/TypeScript**
143
164
  ```js
144
165
  mixpanel.track('<event_name>', {
145
- <event_parameters>
166
+ '<property_name>': '<property_value>'
146
167
  });
147
168
  ```
148
169
 
@@ -155,10 +176,21 @@ See [schema.json](schema.json) for a JSON Schema of the output.
155
176
 
156
177
  **Ruby**
157
178
  ```ruby
158
- tracker.track('distinct_id', '<event_name>', {
179
+ tracker.track('<distinct_id>', '<event_name>', {
159
180
  '<property_name>': '<property_value>'
160
181
  })
161
182
  ```
183
+
184
+ **Go**
185
+ ```go
186
+ ctx := context.Background()
187
+ mp := mixpanel.NewApiClient("YOUR_PROJECT_TOKEN")
188
+ mp.Track(ctx, []*mixpanel.Event{
189
+ mp.NewEvent("<event_name>", "", map[string]any{}{
190
+ "<property_name>": "<property_value>",
191
+ }),
192
+ })
193
+ ```
162
194
  </details>
163
195
 
164
196
  <details>
@@ -177,6 +209,17 @@ See [schema.json](schema.json) for a JSON Schema of the output.
177
209
  '<property_name>': '<property_value>'
178
210
  })
179
211
  ```
212
+
213
+ **Go**
214
+ ```go
215
+ client.Track(amplitude.Event{
216
+ UserID: "<user_id>",
217
+ EventType: "<event_name>",
218
+ EventProperties: map[string]any{}{
219
+ "<property_name>": "<property_value>",
220
+ },
221
+ })
222
+ ```
180
223
  </details>
181
224
 
182
225
  <details>
@@ -191,10 +234,31 @@ See [schema.json](schema.json) for a JSON Schema of the output.
191
234
 
192
235
  **Python**
193
236
  ```python
194
- rudderanalytics.track('<event_name>', {
237
+ rudder_analytics.track('<event_name>', {
195
238
  '<property_name>': '<property_value>'
196
239
  })
197
240
  ```
241
+
242
+ **Ruby**
243
+ ```ruby
244
+ analytics.track(
245
+ user_id: '<user_id>',
246
+ event: '<event_name>',
247
+ properties: {
248
+ '<property_name>': '<property_value>'
249
+ }
250
+ )
251
+ ```
252
+
253
+ **Go**
254
+ ```go
255
+ client.Enqueue(analytics.Track{
256
+ UserId: "<user_id>",
257
+ Event: "<event_name>",
258
+ Properties: analytics.NewProperties().
259
+ Set("<property_name>", "<property_value>"),
260
+ })
261
+ ```
198
262
  </details>
199
263
 
200
264
  <details>
@@ -203,7 +267,7 @@ See [schema.json](schema.json) for a JSON Schema of the output.
203
267
  **JavaScript/TypeScript**
204
268
  ```js
205
269
  mParticle.logEvent('<event_name>', {
206
- <event_parameters>
270
+ '<property_name>': '<property_value>'
207
271
  });
208
272
  ```
209
273
 
@@ -213,6 +277,8 @@ See [schema.json](schema.json) for a JSON Schema of the output.
213
277
  '<property_name>': '<property_value>'
214
278
  })
215
279
  ```
280
+
281
+
216
282
  </details>
217
283
 
218
284
  <details>
@@ -221,7 +287,7 @@ See [schema.json](schema.json) for a JSON Schema of the output.
221
287
  **JavaScript/TypeScript**
222
288
  ```js
223
289
  posthog.capture('<event_name>', {
224
- <event_parameters>
290
+ '<property_name>': '<property_value>'
225
291
  });
226
292
  ```
227
293
 
@@ -254,6 +320,16 @@ See [schema.json](schema.json) for a JSON Schema of the output.
254
320
  }
255
321
  })
256
322
  ```
323
+
324
+ **Go**
325
+ ```go
326
+ client.Enqueue(posthog.Capture{
327
+ DistinctId: "<distinct_id>",
328
+ Event: "<event_name>",
329
+ Properties: posthog.NewProperties().
330
+ Set("<property_name>", "<property_value>"),
331
+ })
332
+ ```
257
333
  </details>
258
334
 
259
335
  <details>
@@ -272,6 +348,8 @@ See [schema.json](schema.json) for a JSON Schema of the output.
272
348
  '<property_name>': '<property_value>'
273
349
  })
274
350
  ```
351
+
352
+
275
353
  </details>
276
354
 
277
355
  <details>
@@ -290,10 +368,12 @@ See [schema.json](schema.json) for a JSON Schema of the output.
290
368
  '<property_name>': '<property_value>'
291
369
  })
292
370
  ```
371
+
372
+
293
373
  </details>
294
374
 
295
375
  <details>
296
- <summary>Snowplow (struct events)</summary>
376
+ <summary>Snowplow (Structured Events)</summary>
297
377
 
298
378
  **JavaScript/TypeScript**
299
379
  ```js
@@ -347,7 +427,16 @@ See [schema.json](schema.json) for a JSON Schema of the output.
347
427
  )
348
428
  ```
349
429
 
350
- _Note: Snowplow Self Describing Events are coming soon!_
430
+ **Go**
431
+ ```go
432
+ tracker.TrackStructEvent(sp.StructuredEvent{
433
+ Category: sp.NewString("<category>"),
434
+ Action: sp.NewString("<action>"),
435
+ Label: sp.NewString("<label>"),
436
+ Property: sp.NewString("<property>"),
437
+ Value: sp.NewFloat64(<value>),
438
+ })
439
+ ```
351
440
  </details>
352
441
 
353
442
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flisk/analyze-tracking",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Analyzes tracking code in a project and generates data schemas",
5
5
  "main": "src/index.js",
6
6
  "bin": {