diff --git a/package-lock.json b/package-lock.json index 34692ef53..b1804d97d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "echarts": "^5.4.3", "logrocket": "^5.0.1", "nanoid": "^4.0.2", + "plausible-tracker": "^0.3.8", "pretty-bytes": "^6.1.1", "prismjs": "^1.29.0", "svelte-confetti": "^1.3.0", @@ -7238,6 +7239,14 @@ "pathe": "^1.1.0" } }, + "node_modules/plausible-tracker": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/plausible-tracker/-/plausible-tracker-0.3.8.tgz", + "integrity": "sha512-lmOWYQ7s9KOUJ1R+YTOR3HrjdbxIS2Z4de0P/Jx2dQPteznJl2eX3tXxKClpvbfyGP59B5bbhW8ftN59HbbFSg==", + "engines": { + "node": ">=10" + } + }, "node_modules/playwright": { "version": "1.38.1", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", diff --git a/package.json b/package.json index e1e775d9f..271057ead 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "echarts": "^5.4.3", "logrocket": "^5.0.1", "nanoid": "^4.0.2", + "plausible-tracker": "^0.3.8", "pretty-bytes": "^6.1.1", "prismjs": "^1.29.0", "svelte-confetti": "^1.3.0", diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 47574d0e9..462af7473 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -1,26 +1,58 @@ +import Analytics, { type AnalyticsPlugin } from 'analytics'; +import googleAnalytics from '@analytics/google-analytics'; +import googleTagManager from '@analytics/google-tag-manager'; +import Plausible from 'plausible-tracker'; +import { get } from 'svelte/store'; import { page } from '$app/stores'; import { user } from '$lib/stores/user'; import { ENV, MODE, VARS, isCloud } from '$lib/system'; -import googleAnalytics from '@analytics/google-analytics'; import { AppwriteException } from '@appwrite.io/console'; -import googleTagManager from '@analytics/google-tag-manager'; -import Analytics from 'analytics'; -import { get } from 'svelte/store'; +import { browser } from '$app/environment'; + +function plausible(domain: string): AnalyticsPlugin { + const instance = Plausible({ + domain + }); + return { + name: 'analytics-plugin-plausible', + page: ({ payload }) => { + instance.trackPageview({ + url: payload.properties.path, + referrer: payload.properties.referrer, + deviceWidth: payload.properties.width + }); + }, + track: ({ payload }) => { + instance.trackEvent( + payload.event, + { + props: payload.properties + }, + { + url: payload.properties.path, + deviceWidth: payload.properties.width + } + ); + }, + loaded: () => true + }; +} const analytics = Analytics({ app: 'appwrite', - plugins: [ - googleAnalytics({ - measurementIds: [VARS.GOOGLE_ANALYTICS || 'G-R4YJ9JN8L4'] - }), - ...(isCloud + plugins: + isCloud && browser ? [ + plausible('cloud.appwrite.io'), googleTagManager({ containerId: [VARS.GOOGLE_TAG || 'GTM-P3T9TBV'] }) ] - : []) - ] + : [ + googleAnalytics({ + measurementIds: [VARS.GOOGLE_ANALYTICS || 'G-R4YJ9JN8L4'] + }) + ] }); export function trackEvent(name: string, data: object = null): void { diff --git a/src/lib/components/permissions/team.svelte b/src/lib/components/permissions/team.svelte index 86209a6e5..5056e1186 100644 --- a/src/lib/components/permissions/team.svelte +++ b/src/lib/components/permissions/team.svelte @@ -119,7 +119,7 @@
There are no teams that match your search.
Need a hand? Learn more in our documentationThere are no Users that match your search.
Need a hand? Learn more in our
documentationcontext.log().
Learn morecontext.log().
Learn morecontext.log().
Learn morecontext.log().
Learn morecontext.log().
Learn more
{/if}
diff --git a/src/lib/pages/domains/wizard/step1.svelte b/src/lib/pages/domains/wizard/step1.svelte
index 2c8a0e884..9d4f60b8c 100644
--- a/src/lib/pages/domains/wizard/step1.svelte
+++ b/src/lib/pages/domains/wizard/step1.svelte
@@ -37,7 +37,7 @@
Your Magic URL login flow is missing a proper redirect URL. Please check the
- Magic URL docs
and send request for new session with a valid redirect URL.
Use templates to send and process account management emails.
Learn more about email templates.
@@ -188,7 +188,7 @@
Use templates to send and process account management mobile messages. Learn more about SMS templates diff --git a/src/routes/console/project-[project]/auth/templates/emailTemplate.svelte b/src/routes/console/project-[project]/auth/templates/emailTemplate.svelte index 807253b83..d045dfacc 100644 --- a/src/routes/console/project-[project]/auth/templates/emailTemplate.svelte +++ b/src/routes/console/project-[project]/auth/templates/emailTemplate.svelte @@ -112,7 +112,8 @@
Click to copy variables for the fields below. Learn more herehere.
No memberships available
-
Choose who can access your collection and documents. For more information, check out the
diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/wizard/step2.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/wizard/step2.svelte
index 7ea47a21f..2abba8752 100644
--- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/wizard/step2.svelte
+++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/wizard/step2.svelte
@@ -10,7 +10,7 @@
You have no repositories.
Need a hand? Learn more in our
documentation
Select events in your Appwrite project that will trigger your function. Learn more about Appwrite Events
Choose who can execute this function using the client API. For more information, check
out the
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte
index 55fdc869a..a347cf509 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte
@@ -58,7 +58,7 @@
Set a Cron schedule to trigger your function. Leave blank for no schedule.
diff --git a/src/routes/console/project-[project]/functions/templates/template-[template]/+page.svelte b/src/routes/console/project-[project]/functions/templates/template-[template]/+page.svelte
index 7ad7157ac..15e43c994 100644
--- a/src/routes/console/project-[project]/functions/templates/template-[template]/+page.svelte
+++ b/src/routes/console/project-[project]/functions/templates/template-[template]/+page.svelte
@@ -73,7 +73,10 @@
In order to clone a template to a locally hosted Appwrite project, you must set
up a Git integration and configure your environment variables.
Select events in your Appwrite project that will trigger your function. Learn more about Appwrite EventsSchedule No data to show
Export data from your project to a self-hosted instance.
Learn more in our documentation.
diff --git a/src/routes/console/project-[project]/settings/updateInstallations.svelte b/src/routes/console/project-[project]/settings/updateInstallations.svelte
index a3c6d5273..116064c7c 100644
--- a/src/routes/console/project-[project]/settings/updateInstallations.svelte
+++ b/src/routes/console/project-[project]/settings/updateInstallations.svelte
@@ -189,7 +189,10 @@
When installing Git in a locally hosted Appwrite project, you must first configure
your environment variables.
Select events in your Appwrite project that will trigger your webhook. Learn more about Appwrite EventsWarning: Untrusted or self-signed
certificates may not be secure.
diff --git a/src/routes/console/project-[project]/settings/webhooks/[webhook]/updateSignature.svelte b/src/routes/console/project-[project]/settings/webhooks/[webhook]/updateSignature.svelte
index 88bbec47b..aefdeba8e 100644
--- a/src/routes/console/project-[project]/settings/webhooks/[webhook]/updateSignature.svelte
+++ b/src/routes/console/project-[project]/settings/webhooks/[webhook]/updateSignature.svelte
@@ -11,7 +11,7 @@
Add the Signature Key to the X-Appwrite-Webhook-Signature header to validate your webhooks. Learn more about webhook validation.
diff --git a/src/routes/console/project-[project]/settings/webhooks/wizard/step2.svelte b/src/routes/console/project-[project]/settings/webhooks/wizard/step2.svelte
index 252899fc2..e0f4d469d 100644
--- a/src/routes/console/project-[project]/settings/webhooks/wizard/step2.svelte
+++ b/src/routes/console/project-[project]/settings/webhooks/wizard/step2.svelte
@@ -58,7 +58,7 @@
Select events in your Appwrite project that will trigger your webhook. Learn more about Appwrite EventsWarning: Untrusted or self-signed certificates
may not be secure.
diff --git a/src/routes/console/project-[project]/storage/+page.svelte b/src/routes/console/project-[project]/storage/+page.svelte
index 4b5d27e3f..204e216ae 100644
--- a/src/routes/console/project-[project]/storage/+page.svelte
+++ b/src/routes/console/project-[project]/storage/+page.svelte
@@ -89,7 +89,7 @@
{:else}
There are no files that match your search.
Choose who can access your buckets and files. For more information, check out the
diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/settings/+page.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/settings/+page.svelte
index 1305d5369..0b3d4ec63 100644
--- a/src/routes/console/project-[project]/storage/bucket-[bucket]/settings/+page.svelte
+++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/settings/+page.svelte
@@ -269,7 +269,7 @@
Choose who can access your buckets and files. For more information, check out
the