mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-23 06:10:32 +00:00
feat: instrument personal subscription dialog + dedupe GTM event
Addresses code review:
- Add 'subscription_required_dialog' surface for the personal-tier
SubscriptionRequiredDialogContent.vue (the dialog reached via
showSubscriptionDialog() for non-workspace users), which was
previously uninstrumented despite being a primary paywall path.
- Map trackPaywallViewed() in GtmTelemetryProvider to a distinct
'paywall_viewed' GA4 event instead of 'view_promotion', which
trackSubscription('modal_opened') already emits — avoids
double-counting impressions on the GTM side.
This commit is contained in:
@@ -145,7 +145,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, watch } from 'vue'
|
||||
import { computed, onMounted, watch } from 'vue'
|
||||
|
||||
import CloudBadge from '@/components/topbar/CloudBadge.vue'
|
||||
import Button from '@/components/ui/button/Button.vue'
|
||||
@@ -169,7 +169,7 @@ const emit = defineEmits<{
|
||||
close: [subscribed: boolean]
|
||||
}>()
|
||||
|
||||
const { isActiveSubscription } = useBillingContext()
|
||||
const { isActiveSubscription, subscription } = useBillingContext()
|
||||
|
||||
const isSubscriptionEnabled = (): boolean =>
|
||||
Boolean(isCloud && window.__CONFIG__?.subscription_required)
|
||||
@@ -199,6 +199,14 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
telemetry?.trackPaywallViewed({
|
||||
surface: 'subscription_required_dialog',
|
||||
current_tier: subscription.value?.tier?.toLowerCase(),
|
||||
reason
|
||||
})
|
||||
})
|
||||
|
||||
const handleSubscribed = () => {
|
||||
emit('close', true)
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ export class GtmTelemetryProvider implements TelemetryProvider {
|
||||
}
|
||||
|
||||
trackPaywallViewed(metadata: PaywallViewedMetadata): void {
|
||||
this.pushEvent('view_promotion', { ...metadata })
|
||||
this.pushEvent('paywall_viewed', { ...metadata })
|
||||
}
|
||||
|
||||
trackSignupOpened(): void {
|
||||
|
||||
@@ -347,6 +347,7 @@ export interface SubscriptionMetadata {
|
||||
*/
|
||||
export type PaywallSurface =
|
||||
| 'free_tier_dialog'
|
||||
| 'subscription_required_dialog'
|
||||
| 'subscription_required_dialog_workspace'
|
||||
| 'upload_model_upgrade_modal'
|
||||
| 'invite_member_upsell'
|
||||
|
||||
Reference in New Issue
Block a user