Skip to content

Commit 5933463

Browse files
authored
Merge pull request #1582 from appwrite/add-tracking
Add proper tracking
2 parents 0fdcf7c + 4d8b273 commit 5933463

File tree

7 files changed

+50
-43
lines changed

7 files changed

+50
-43
lines changed

docker/production.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ services:
123123
image: ghcr.io/appwrite/monitoring:0.1.0
124124
entrypoint: monitoring
125125
command:
126-
- "--url=${_APP_BETTER_STACK_INCIDENT_URL}"
127-
- "--interval=60"
128-
- "--cpu-limit=85"
129-
- "--memory-limit=80"
130-
- "--disk-limit=85"
131-
hostname: "{{.Node.Hostname}}"
126+
- '--url=${_APP_BETTER_STACK_INCIDENT_URL}'
127+
- '--interval=60'
128+
- '--cpu-limit=85'
129+
- '--memory-limit=80'
130+
- '--disk-limit=85'
131+
hostname: '{{.Node.Hostname}}'
132132
<<: *x-logging
133133
volumes:
134134
- /mnt:/mnt:ro

docker/stage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ services:
118118
image: ghcr.io/appwrite/monitoring:0.1.0
119119
entrypoint: monitoring
120120
command:
121-
- "--url=${_APP_BETTER_STACK_INCIDENT_URL}"
122-
- "--interval=60"
123-
- "--cpu-limit=85"
124-
- "--memory-limit=80"
125-
- "--disk-limit=85"
126-
hostname: "{{.Node.Hostname}}"
121+
- '--url=${_APP_BETTER_STACK_INCIDENT_URL}'
122+
- '--interval=60'
123+
- '--cpu-limit=85'
124+
- '--memory-limit=80'
125+
- '--disk-limit=85'
126+
hostname: '{{.Node.Hostname}}'
127127
<<: *x-logging
128128
volumes:
129129
- /mnt:/mnt:ro

src/lib/actions/analytics.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,4 @@ export const trackEvent = async (name: string, data: object = {}) => {
6969
}
7070
};
7171

72-
export function isTrackingAllowed() {
73-
if (ENV.TEST) {
74-
return;
75-
}
76-
if (window.navigator?.doNotTrack) {
77-
if (navigator.doNotTrack === '1' || navigator.doNotTrack === 'yes') {
78-
return false;
79-
} else {
80-
return true;
81-
}
82-
} else {
83-
return true;
84-
}
85-
}
72+
export const isTrackingAllowed = () => !ENV.TEST;

src/lib/components/AppwriteIn100Seconds.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
22
import { fade, scale } from 'svelte/transition';
3+
import { trackEvent } from '$lib/actions/analytics';
34
45
let show = false;
56
@@ -13,7 +14,13 @@
1314

1415
<svelte:window on:keydown={handleKeypress} />
1516

16-
<button on:click={() => (show = true)} class="web-button is-secondary cursor-pointer">
17+
<button
18+
on:click={() => {
19+
show = true;
20+
trackEvent('Appwrite in 100 seconds');
21+
}}
22+
class="web-button is-secondary cursor-pointer"
23+
>
1724
<span class="web-icon-play" style:color="unset" />
1825
<span>Appwrite in 100 seconds</span>
1926
</button>

src/lib/components/IsLoggedIn.svelte

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,25 @@
22
import { PUBLIC_APPWRITE_DASHBOARD } from '$env/static/public';
33
import { classNames } from '$lib/utils/classnames';
44
import { trackEvent } from '$lib/actions/analytics';
5+
import { browser } from '$app/environment';
56
67
export let classes = '';
8+
9+
function getTrackingEventName() {
10+
return browser
11+
? 'loggedIn' in document.body.dataset
12+
? 'Go to console'
13+
: 'Get started'
14+
: 'Get started';
15+
}
716
</script>
817

918
<a
1019
class={classNames('web-button web-u-inline-width-100-percent-mobile', classes)}
1120
href={PUBLIC_APPWRITE_DASHBOARD}
12-
on:click={() => trackEvent('Get started/go to console in header')}
21+
on:click={() => {
22+
trackEvent(`${getTrackingEventName()} in header`);
23+
}}
1324
>
1425
<span class="hidden group-[&[data-logged-in]]/body:block">Go to Console</span>
1526
<span class="block group-[&[data-logged-in]]/body:hidden">Get started</span>

src/lib/components/ProductsSubmenu.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
import { dev } from '$app/environment';
7272
import { classNames } from '$lib/utils/classnames';
7373
import { createDropdownMenu, melt } from '@melt-ui/svelte';
74+
import { trackEvent } from '$lib/actions/analytics';
7475
7576
const {
7677
elements: { trigger, menu, item, overlay },
@@ -120,6 +121,7 @@
120121
<a
121122
href={product.href}
122123
use:melt={$item}
124+
on:click={() => trackEvent(`${product.name} in products submenu`)}
123125
class="group flex gap-3 rounded-xl p-1 text-white outline-none transition-colors focus:bg-white/8"
124126
>
125127
<div
@@ -159,7 +161,7 @@
159161
<header class="flex items-center justify-between">
160162
<span
161163
class="font-aeonik-fono tracking-loose text-secondary block text-xs uppercase"
162-
>Case studies<span class="text-accent">_</span></span
164+
>Customer stories<span class="text-accent">_</span></span
163165
>
164166
<a
165167
href="/blog/category/case-studies"

src/partials/prohibited-activities.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
The following actions are prohibited on the Appwrite platform and may lead to immediate suspension or termination:
44

5-
* **Illegal and harmful content:** Sharing any content that is illegal, infringing (e.g., copyright infringement), harmful, threatening, defamatory, obscene, harassing, or otherwise objectionable. This includes distributing malware, viruses, or any malicious code.
6-
* **Unauthorized access and disruption:** Accessing or attempting to access any system, data, or account without authorization. This includes:
7-
* Hacking
8-
* Penetration testing without approval
9-
* Denial-of-Service (DoS) attacks
10-
* Disrupting Appwrite Cloud's integrity or performance (e.g., excessive resource usage, unauthorized load testing)
11-
* **Deceptive practices:** Engaging in any fraudulent or deceptive activity, such as:
12-
* Phishing
13-
* Misleading others
14-
* Circumventing payment obligations
15-
* **Unsolicited communications:** Sending spam, unauthorized advertising, or any form of improper solicitation.
16-
* **Misuse of resources:**
17-
* Using Appwrite Cloud for cryptocurrency mining without authorization
18-
* Violating any applicable laws or regulations
5+
- **Illegal and harmful content:** Sharing any content that is illegal, infringing (e.g., copyright infringement), harmful, threatening, defamatory, obscene, harassing, or otherwise objectionable. This includes distributing malware, viruses, or any malicious code.
6+
- **Unauthorized access and disruption:** Accessing or attempting to access any system, data, or account without authorization. This includes:
7+
- Hacking
8+
- Penetration testing without approval
9+
- Denial-of-Service (DoS) attacks
10+
- Disrupting Appwrite Cloud's integrity or performance (e.g., excessive resource usage, unauthorized load testing)
11+
- **Deceptive practices:** Engaging in any fraudulent or deceptive activity, such as:
12+
- Phishing
13+
- Misleading others
14+
- Circumventing payment obligations
15+
- **Unsolicited communications:** Sending spam, unauthorized advertising, or any form of improper solicitation.
16+
- **Misuse of resources:**
17+
- Using Appwrite Cloud for cryptocurrency mining without authorization
18+
- Violating any applicable laws or regulations

0 commit comments

Comments
 (0)