@@ -73,20 +73,12 @@ export const command = new Command("ext:install [extensionRef]")
73
73
// Should parse spec locally so we don't need project ID.
74
74
source = await createSourceFromLocation ( needProjectId ( { projectId } ) , extensionRef ) ;
75
75
await displayExtensionVersionInfo ( { spec : source . spec } ) ;
76
- void trackGA4 ( "extension_added_to_manifest" , {
77
- published : "local" ,
78
- interactive : options . nonInteractive ? "false" : "true" ,
79
- } ) ;
80
76
} else {
81
77
const extension = await extensionsApi . getExtension ( extensionRef ) ;
82
78
const ref = refs . parse ( extensionRef ) ;
83
79
ref . version = await resolveVersion ( ref , extension ) ;
84
80
const extensionVersionRef = refs . toExtensionVersionRef ( ref ) ;
85
81
extensionVersion = await extensionsApi . getExtensionVersion ( extensionVersionRef ) ;
86
- void trackGA4 ( "extension_added_to_manifest" , {
87
- published : extensionVersion . listing ?. state === "APPROVED" ? "published" : "uploaded" ,
88
- interactive : options . nonInteractive ? "false" : "true" ,
89
- } ) ;
90
82
await displayExtensionVersionInfo ( {
91
83
spec : extensionVersion . spec ,
92
84
extensionVersion,
@@ -143,6 +135,19 @@ export const command = new Command("ext:install [extensionRef]")
143
135
) } '. Please make sure this is a valid extension and try again.`
144
136
) ;
145
137
}
138
+
139
+ if ( source ) {
140
+ void trackGA4 ( "extension_added_to_manifest" , {
141
+ published : "local" ,
142
+ interactive : options . nonInteractive ? "false" : "true" ,
143
+ } ) ;
144
+ } else if ( extensionVersion ) {
145
+ void trackGA4 ( "extension_added_to_manifest" , {
146
+ published : extensionVersion . listing ?. state === "APPROVED" ? "published" : "uploaded" ,
147
+ interactive : options . nonInteractive ? "false" : "true" ,
148
+ } ) ;
149
+ }
150
+
146
151
try {
147
152
return installToManifest ( {
148
153
projectId,
0 commit comments