Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

PP events (#20491)

Francesco Sansalvadoread44626f860c
diff --git a/apps/www/lib/gaEvents.ts b/apps/www/lib/gaEvents.ts
index a9db7dead20..6712c3d74fe 100644
--- a/apps/www/lib/gaEvents.ts
+++ b/apps/www/lib/gaEvents.ts
@@ -40,6 +40,51 @@ const TelemetryEvents: TelemetryEventType = {
category: 'link',
label: '',
},
+ www_hp_subhero_products_vector: {
+ action: 'www_hp_subhero_products_vector',
+ category: 'link',
+ label: '',
+ },
+ www_pricing_hero_plan_free: {
+ action: 'www_pricing_hero_plan_free',
+ category: 'link',
+ label: '',
+ },
+ www_pricing_hero_plan_pro: {
+ action: 'www_pricing_hero_plan_pro',
+ category: 'link',
+ label: '',
+ },
+ www_pricing_hero_plan_team: {
+ action: 'www_pricing_hero_plan_team',
+ category: 'link',
+ label: '',
+ },
+ www_pricing_hero_plan_enterprise: {
+ action: 'www_pricing_hero_plan_enterprise',
+ category: 'link',
+ label: '',
+ },
+ www_pricing_comparison_free: {
+ action: 'www_pricing_comparison_free',
+ category: 'link',
+ label: '',
+ },
+ www_pricing_comparison_pro: {
+ action: 'www_pricing_comparison_pro',
+ category: 'link',
+ label: '',
+ },
+ www_pricing_comparison_team: {
+ action: 'www_pricing_comparison_team',
+ category: 'link',
+ label: '',
+ },
+ www_pricing_comparison_enterprise: {
+ action: 'www_pricing_comparison_enterprise',
+ category: 'link',
+ label: '',
+ },
}
export default TelemetryEvents
diff --git a/apps/www/pages/pricing/index.tsx b/apps/www/pages/pricing/index.tsx
index 34206aca4e8..8389c9122d8 100644
--- a/apps/www/pages/pricing/index.tsx
+++ b/apps/www/pages/pricing/index.tsx
@@ -6,6 +6,8 @@ import { useRouter } from 'next/router'
import { NextSeo } from 'next-seo'
import { useTheme } from 'next-themes'
import { Accordion, Button, IconCheck, Select } from 'ui'
+import Telemetry, { TelemetryEvent } from '~/lib/telemetry'
+import { useTelemetryProps } from 'common/hooks/useTelemetryProps'
import AnnouncementBadge from '~/components/Announcement/Badge'
import CTABanner from '~/components/CTABanner'
@@ -13,6 +15,7 @@ import ComputePricingModal from '~/components/Pricing/ComputePricingModal'
import DefaultLayout from '~/components/Layouts/Default'
import { PricingTableRowDesktop, PricingTableRowMobile } from '~/components/Pricing/PricingTableRow'
+import gaEvents from '~/lib/gaEvents'
import Solutions from '~/data/Solutions'
import pricingFaq from '~/data/PricingFAQ.json'
import { pricing } from 'shared-data/pricing'
@@ -53,6 +56,11 @@ export default function IndexPage() {
}
}, [asPath])
+ const telemetryProps = useTelemetryProps()
+ const sendTelemetryEvent = async (event: TelemetryEvent) => {
+ await Telemetry.sendEvent(event, telemetryProps, router)
+ }
+
const addons = [
{
name: 'Optimized Compute',
@@ -291,11 +299,18 @@ export default function IndexPage() {
<p className="text-[13px] whitespace-pre-wrap">{plan.footer}</p>
)}
</div>
- <a href={plan.href}>
- <Button block size="small">
+ <Button block size="small" asChild>
+ <Link
+ href={plan.href}
+ onClick={() =>
+ sendTelemetryEvent(
+ gaEvents[`www_pricing_hero_plan_${plan.name.toLowerCase()}`]
+ )
+ }
+ >
{plan.cta}
- </Button>
- </a>
+ </Link>
+ </Button>
</div>
</div>
</div>
@@ -773,7 +788,14 @@ export default function IndexPage() {
type={plan.name === 'Enterprise' ? 'default' : 'primary'}
block
>
- <Link href={plan.href} as={plan.href}>
+ <Link
+ href={plan.href}
+ onClick={() =>
+ sendTelemetryEvent(
+ gaEvents[`www_pricing_comparison_${plan.name.toLowerCase()}`]
+ )
+ }
+ >
{plan.cta}
</Link>
</Button>