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:
Glary-Bot
2026-05-20 04:36:44 +00:00
parent 863bc73b10
commit e75d2f8940
3 changed files with 12 additions and 3 deletions

View File

@@ -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)
}

View File

@@ -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 {

View File

@@ -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'