@@ -189,6 +189,7 @@ export function reportFaucetUsed(properties: {
189
189
chainId : properties . chainId ,
190
190
} ) ;
191
191
}
192
+
192
193
// ----------------------------
193
194
// CHAIN CONFIGURATION
194
195
// ----------------------------
@@ -222,140 +223,161 @@ export function reportChainConfigurationAdded(properties: {
222
223
// ASSETS
223
224
// ----------------------------
224
225
225
- type StatusWithError =
226
- | {
227
- status : "successful" | "attempted" ;
228
- }
229
- | {
230
- status : "failed" ;
231
- error : string ;
232
- } ;
233
-
234
226
type AssetContractType = "DropERC20" | "DropERC1155" | "DropERC721" ;
235
227
236
228
/**
237
229
* ### Why do we need to report this event?
238
- * - To track asset buy statuses (successful, failed, attempted) in the new asset pages
230
+ * - To track number of successful asset purchases from the asset page
231
+ * - To track which asset and contract types are being purchased the most
239
232
*
240
233
* ### Who is responsible for this event?
241
234
* @MananTank
242
- *
243
235
*/
244
- export function reportAssetBuy (
245
- properties : {
246
- chainId : number ;
247
- assetType : "NFT" | "Coin" ;
248
- contractType : AssetContractType ;
249
- } & StatusWithError ,
250
- ) {
251
- // Example: asset buy NFT successful
252
- posthog . capture ( `asset buy ${ properties . assetType } ${ properties . status } ` , {
236
+ export function reportAssetBuySuccessful ( properties : {
237
+ chainId : number ;
238
+ contractType : AssetContractType ;
239
+ assetType : "nft" | "coin" ;
240
+ } ) {
241
+ posthog . capture ( "asset buy successful" , {
253
242
chainId : properties . chainId ,
254
243
contractType : properties . contractType ,
255
- ...( properties . status === "failed" && {
256
- error : properties . error ,
257
- } ) ,
244
+ assetType : properties . assetType ,
258
245
} ) ;
259
246
}
260
247
261
248
/**
262
249
* ### Why do we need to report this event?
263
- * - To track the CTA card clicks on the assets page
250
+ * - To track number of failed asset purchases from the asset page
251
+ * - To track the errors that users encounter when trying to purchase an asset
264
252
*
265
253
* ### Who is responsible for this event?
266
254
* @MananTank
255
+ */
256
+ export function reportAssetBuyFailed ( properties : {
257
+ chainId : number ;
258
+ contractType : AssetContractType ;
259
+ assetType : "nft" | "coin" ;
260
+ error : string ;
261
+ } ) {
262
+ posthog . capture ( "asset buy failed" , {
263
+ chainId : properties . chainId ,
264
+ contractType : properties . contractType ,
265
+ assetType : properties . assetType ,
266
+ error : properties . error ,
267
+ } ) ;
268
+ }
269
+
270
+ // Assets Landing Page ----------------------------
271
+
272
+ /**
273
+ * ### Why do we need to report this event?
274
+ * - To track number of asset creation started from the assets page
275
+ * - To track which asset types are being created the most
267
276
*
277
+ * ### Who is responsible for this event?
278
+ * @MananTank
268
279
*/
269
- export function reportAssetsPageCardClick ( properties : {
270
- label : "create- nft-collection " | "import-asset" | "create- coin";
280
+ export function reportAssetCreationStarted ( properties : {
281
+ assetType : "nft" | "coin" ;
271
282
} ) {
272
- // Example: asset page card create-nft-collection clicked
273
- posthog . capture ( `assets page card ${ properties . label } clicked` ) ;
283
+ posthog . capture ( "asset creation started" , {
284
+ assetType : properties . assetType ,
285
+ } ) ;
286
+ }
287
+
288
+ /**
289
+ * ### Why do we need to report this event?
290
+ * - To track number of assets imported successfully from the assets page
291
+ *
292
+ * ### Who is responsible for this event?
293
+ * @MananTank
294
+ */
295
+ export function reportAssetImportSuccessful ( ) {
296
+ posthog . capture ( "asset import successful" ) ;
274
297
}
275
298
276
299
/**
277
300
* ### Why do we need to report this event?
278
- * - To track the steps that users are going through in asset creation flow
301
+ * - To track number of asset import started in the assets page
279
302
*
280
303
* ### Who is responsible for this event?
281
304
* @MananTank
305
+ */
306
+ export function reportAssetImportStarted ( ) {
307
+ posthog . capture ( "asset import started" ) ;
308
+ }
309
+
310
+ /**
311
+ * ### Why do we need to report this event?
312
+ * - To track the steps users are configuring in the asset creation to understand if there are any drop-offs
282
313
*
314
+ * ### Who is responsible for this event?
315
+ * @MananTank
283
316
*/
284
- export function reportCreateAssetStepNextClicked (
317
+ export function reportAssetCreationStepConfigured (
285
318
properties :
286
319
| {
287
- assetType : "NFT " ;
288
- page : "collection-info" | "upload-assets" | "sales-settings" ;
320
+ assetType : "nft " ;
321
+ step : "collection-info" | "upload-assets" | "sales-settings" ;
289
322
}
290
323
| {
291
- assetType : "Coin " ;
292
- page : "coin-info" | "token-distribution" | "launch-coin" ;
324
+ assetType : "coin " ;
325
+ step : "coin-info" | "token-distribution" | "launch-coin" ;
293
326
} ,
294
327
) {
295
- // Example: create asset NFT collection-info next clicked
296
- posthog . capture (
297
- `create asset ${ properties . assetType } ${ properties . page } next clicked` ,
298
- ) ;
328
+ posthog . capture ( " asset creation step configured" , {
329
+ assetType : properties . assetType ,
330
+ step : properties . step ,
331
+ } ) ;
299
332
}
300
333
301
334
/**
302
335
* ### Why do we need to report this event?
303
- * - To track the status of each step of the create asset flow
336
+ * - To track number of successful asset creations
337
+ * - To track which asset types are being created the most
304
338
*
305
339
* ### Who is responsible for this event?
306
340
* @MananTank
341
+ */
342
+ export function reportAssetCreationSuccessful ( properties : {
343
+ assetType : "nft" | "coin" ;
344
+ contractType : AssetContractType ;
345
+ } ) {
346
+ posthog . capture ( "asset creation successful" , {
347
+ assetType : properties . assetType ,
348
+ contractType : properties . contractType ,
349
+ } ) ;
350
+ }
351
+
352
+ /**
353
+ * ### Why do we need to report this event?
354
+ * - To track number of failed asset creations
355
+ * - To track the errors that users encounter when trying to create an asset
356
+ * - To track the step that is failing in the asset creation
307
357
*
358
+ * ### Who is responsible for this event?
359
+ * @MananTank
308
360
*/
309
- export function reportCreateAssetStepStatus (
310
- properties : (
361
+ export function reportAssetCreationFailed (
362
+ properties : { contractType : AssetContractType ; error : string } & (
311
363
| {
312
- assetType : "NFT " ;
313
- step : "deploy-contract" | "lazy- mint-nfts" | "set-claim-conditions" ;
364
+ assetType : "nft " ;
365
+ step : "deploy-contract" | "mint-nfts" | "set-claim-conditions" ;
314
366
}
315
367
| {
316
- assetType : "Coin " ;
368
+ assetType : "coin " ;
317
369
step :
318
370
| "deploy-contract"
319
371
| "set-claim-conditions"
320
372
| "mint-tokens"
321
373
| "airdrop-tokens" ;
322
374
}
323
- ) &
324
- StatusWithError & {
325
- contractType : AssetContractType ;
326
- } ,
327
- ) {
328
- // Example: create asset NFT deploy-contract successful
329
- posthog . capture (
330
- `create asset ${ properties . assetType } ${ properties . step } ${ properties . status } ` ,
331
- {
332
- ...( properties . status === "failed" && {
333
- error : properties . error ,
334
- } ) ,
335
- contractType : properties . contractType ,
336
- } ,
337
- ) ;
338
- }
339
-
340
- /**
341
- * ### Why do we need to report this event?
342
- * - To track the status of create asset as a whole (successful, failed, attempted)
343
- *
344
- * ### Who is responsible for this event?
345
- * @MananTank
346
- *
347
- */
348
- export function reportCreateAssetStatus (
349
- properties : {
350
- assetType : "NFT" | "Coin" ;
351
- contractType : AssetContractType ;
352
- } & StatusWithError ,
375
+ ) ,
353
376
) {
354
- // Example: create asset NFT successful
355
- posthog . capture ( `create asset ${ properties . assetType } ${ properties . status } ` , {
356
- ...( properties . status === "failed" && {
357
- error : properties . error ,
358
- } ) ,
377
+ posthog . capture ( "asset creation failed" , {
378
+ assetType : properties . assetType ,
359
379
contractType : properties . contractType ,
380
+ error : properties . error ,
381
+ step : properties . step ,
360
382
} ) ;
361
383
}
0 commit comments