mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
add: trackEvents for promo modals.
This commit is contained in:
@@ -15,10 +15,13 @@
|
||||
import { addBottomModalAlerts } from '$routes/(console)/bottomAlerts';
|
||||
import { project } from '$routes/(console)/project-[project]/store';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let currentIndex = 0;
|
||||
let openModalOnMobile = false;
|
||||
|
||||
const promoId = (alertId: string) => alertId.replace(/(banner:|modal:)/g, '');
|
||||
|
||||
function getPageScope(pathname: string) {
|
||||
const isProjectPage = pathname.includes('project-[project]');
|
||||
const isOrganizationPage = pathname.includes('organization-[organization]');
|
||||
@@ -167,7 +170,13 @@
|
||||
project: $project
|
||||
})}
|
||||
external={!!currentModalAlert.cta.external}
|
||||
fullWidthMobile>
|
||||
fullWidthMobile
|
||||
on:click={() => {
|
||||
trackEvent('click_promo', {
|
||||
promo: promoId(currentModalAlert.id),
|
||||
type: shouldShowUpgrade ? 'upgrade' : 'try_now'
|
||||
});
|
||||
}}>
|
||||
{currentModalAlert.cta.text}
|
||||
</Button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user