File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ describe('--marketplace flag wiring', () => {
9393 // true — a swallowed network/clone failure (return false) must NOT bump
9494 // the marketplace's install count.
9595 expect ( createSource ) . toMatch ( / c o n s t d o w n l o a d e d = a w a i t d o w n l o a d G i t H u b T e m p l a t e / ) ;
96- expect ( createSource ) . toMatch ( / i f \( d o w n l o a d e d \) [ \s \S ] { 0 , 80 } r e p o r t M a r k e t p l a c e D o w n l o a d / ) ;
96+ expect ( createSource ) . toMatch ( / i f \( d o w n l o a d e d \) [ \s \S ] { 0 , 200 } r e p o r t M a r k e t p l a c e D o w n l o a d / ) ;
9797 } ) ;
9898
9999 it ( 'does NOT emit a PostHog template_selected event with a marketplace property' , ( ) => {
Original file line number Diff line number Diff line change @@ -382,6 +382,9 @@ export function registerCreateCommand(program: Command): void {
382382 json ,
383383 ) ;
384384 if ( downloaded ) {
385+ captureEvent ( orgId , 'marketplace_template_downloaded' , {
386+ template : opts . marketplace ,
387+ } ) ;
385388 void reportMarketplaceDownload ( opts . marketplace as string ) ;
386389 }
387390 } else if ( githubTemplates . includes ( template ! ) ) {
@@ -745,8 +748,9 @@ const MARKETPLACE_REPORT_URL =
745748/**
746749 * Fire-and-forget POST to the marketplace download counter.
747750 * Network errors and non-2xx responses are swallowed — a transient
748- * counter blip must not kill the install. The DB counter is the source
749- * of truth; PostHog is intentionally not used (per spec §6.3).
751+ * counter blip must not kill the install. This DB counter only backs
752+ * the download number shown on the template page; PostHog is the
753+ * source of truth for download analytics.
750754 */
751755export async function reportMarketplaceDownload ( slug : string ) : Promise < void > {
752756 try {
You can’t perform that action at this time.
0 commit comments