Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

chore: update documentation and file structure

Bill Yang2d5ab21f4511
diff --git a/.prettierignore b/.prettierignore
index 75e397a62..83da85ba9 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,2 +1,3 @@
# So minified script is not formatted
-**/script.js
\ No newline at end of file
+**/script.js
+**/*.mdx
diff --git a/docs/src/app/page.jsx b/docs/src/app/page.jsx
index db32e2561..000c99415 100644
--- a/docs/src/app/page.jsx
+++ b/docs/src/app/page.jsx
@@ -311,7 +311,7 @@ export default function IndexPage() {
</AccordionTrigger>
<AccordionContent className="px-6 pb-4 text-neutral-300">
<Link
- href="/docs/tracker"
+ href="/docs/script"
className="text-emerald-400 hover:text-emerald-300"
>
Setting up Rybbit
diff --git a/docs/src/content/_meta.js b/docs/src/content/_meta.js
index edc27425e..f67f5bacd 100644
--- a/docs/src/content/_meta.js
+++ b/docs/src/content/_meta.js
@@ -5,8 +5,9 @@ export default {
type: "separator",
title: "Tracking",
},
- tracker: "",
+ script: "",
"track-events": "",
+ sdks: "SDKs",
integrations: "",
_4: {
type: "separator",
@@ -15,16 +16,11 @@ export default {
"self-hosting": "",
"self-hosting-advanced": "",
"self-hosting-nginx": "",
- _5: {
- type: "separator",
- title: "SDKs",
- },
- web: "",
_6: {
type: "separator",
title: "Settings",
},
- "adding-users": "",
+ "inviting-users": "",
"public-site": "",
"enhanced-privacy": "",
"changing-domains": "",
diff --git a/docs/src/content/adding-users.mdx b/docs/src/content/adding-users.mdx
deleted file mode 100644
index 93eb64453..000000000
--- a/docs/src/content/adding-users.mdx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Steps } from 'nextra/components'
-import { Callout } from 'nextra/components'
-
-# Adding Users
-
-Both the cloud and self-hosted versions of Rybbit support adding users to your organization.
-
-<Steps>
-### 1. Account creation
-
-Have your user (or you for them) sign up for an account with their email address. Skip creating a organization, since you will be adding them to your existing organization.
-
-### 2. Add the user to your organization
-
-Go to https://app.rybbit.io/organization (replace domain with your own if self-hosted) on your admin account and click the "Add Member" button in the top right.
-
-### 3. Select the user's role
-
-You can either make the user an admin or a member.
-
-**Admins** can invite other users, add websites, edit websites, delete websites, and see all website data.
-
-**Members** can see all website data, but they cannot edit anything.
-
-</Steps>
-
-<Callout type="info">
- Currently, each user can only be in one organization.
-</Callout>
-
diff --git a/docs/src/content/index.mdx b/docs/src/content/index.mdx
index 9d4961e21..d7b7d5154 100644
--- a/docs/src/content/index.mdx
+++ b/docs/src/content/index.mdx
@@ -1,4 +1,4 @@
-import { Bleed } from 'nextra/components'
+import { Bleed } from "nextra/components";
# Introduction
@@ -18,10 +18,10 @@ import { Bleed } from 'nextra/components'
Choose the option that's right for you:
-- **Cloud Version:** Sign up for the hosted version at [rybbit.io/signup](https://app.rybbit.io/signup). Get up and running in minutes.
-- **Self-Host:** Follow our [Self-Hosting Guide](./docs/self-hosting) to set up Rybbit on your own server.
+- **Cloud Version:** Sign up for the hosted version at [rybbit.io/signup](https://app.rybbit.io/signup). Get up and running in minutes.
+- **Self-Host:** Follow our [Self-Hosting Guide](./docs/self-hosting) to set up Rybbit on your own server.
-And then learn how to add the [Tracking Script](./docs/tracker) to your website to start collecting data.
+And then learn how to add the [Tracking Script](./docs/script) to your website to start collecting data.
## Code
diff --git a/docs/src/content/integrations/google-tag-manager.mdx b/docs/src/content/integrations/google-tag-manager.mdx
index ab49c98b0..3b55a7488 100644
--- a/docs/src/content/integrations/google-tag-manager.mdx
+++ b/docs/src/content/integrations/google-tag-manager.mdx
@@ -26,7 +26,7 @@ However, GTM sanitizes script tags by removing non-standard HTML attributes like
```javascript
<script>
(function() {
- let el = document.createElement("script");
+ var el = document.createElement("script");
el.src = "https://app.rybbit.io/api/script.js";
el.async = true;
el.setAttribute("data-site-id", "YOUR_SITE_ID");
diff --git a/docs/src/content/inviting-users.mdx b/docs/src/content/inviting-users.mdx
new file mode 100644
index 000000000..dbe76679e
--- /dev/null
+++ b/docs/src/content/inviting-users.mdx
@@ -0,0 +1,31 @@
+import { Steps } from 'nextra/components'
+import { Callout } from 'nextra/components'
+
+# Inviting Users
+
+Currently only the cloud version of Rybbit supports inviting users.
+
+<Steps>
+
+### 1. Add the user to your organization
+
+Go to https://app.rybbit.io/organization "Add Member" button in the top right. Enter the user's email address and select the user's role.
+
+### 2. Select the user's role
+
+You can either make the user an admin or a member.
+
+**Admins** can invite other users, add websites, edit websites, delete websites, and see all website data.
+
+**Members** can see all website data, but they cannot edit anything.
+
+### 3. Send the invite
+
+Click the "Invite" button. The user will receive an email with a link to sign up for Rybbit. You can manage all invites in the organizations tab.
+
+</Steps>
+
+<Callout type="info">
+ Currently, each user can only be in one organization.
+</Callout>
+
diff --git a/docs/src/content/script.mdx b/docs/src/content/script.mdx
new file mode 100644
index 000000000..bc58b3a0e
--- /dev/null
+++ b/docs/src/content/script.mdx
@@ -0,0 +1,56 @@
+import { Bleed } from "nextra/components";
+
+# Tracking Script
+
+To start tracking user activity on your website, add the Rybbit tracking script to your site's HTML.
+
+## Installation
+The webpage should give you this script tag like this when you first add a website. Place it within the `<head>` section of your website. Include it on every page you wish to track.
+
+```html
+<script src="https://app.rybbit.io/api/script.js" async data-site-id="YOUR_SITE_ID"></script>
+```
+If you are self-hosting Rybbit `app.rybbit.io` will be domain of your Rybbit instance.
+
+## Configuration Options
+
+You can customize the script's behavior using `data-*` attributes on the `<script>` tag:
+| Attribute | Type | Default | Description |
+| :---------------- | :--------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `data-track-spa` | `string` | `"true"`| Set to `"false"` to disable automatic pageview tracking for single page applications (React, Vue, etc). You will need to manually call `window.rybbit.pageview()` or `window.rybbit.track()` for all but the initial pageview. |
+| `data-track-query`| `string` | `"true"`| Set to `"false"` to disable tracking of URL query strings. This enhances privacy by preventing potentially sensitive information in query parameters from being stored in your analytics data. |
+| `data-skip-patterns` | `string` | `[]` | A JSON string array of URL path patterns to ignore. Pageviews matching these patterns won't be tracked. Supports two types of wildcards: `*` (matches within a segment) and `**` (matches across segments). |
+| `data-mask-patterns` | `string` | `[]` | A JSON string array of URL path patterns to mask for privacy. Pageviews matching these patterns will be tracked, but the actual URL path will be replaced with the pattern itself in analytics data. Supports the same wildcards as `data-skip-patterns`. |
+| `data-debounce` | `string` | `"500"`| The delay (in milliseconds) before tracking a pageview after URL changes via the History API (`pushState`, `replaceState`). Set to `0` to disable debouncing. |
+
+### Pattern Matching Details
+
+For `data-skip-patterns` and `data-mask-patterns`, two types of wildcards are supported:
+- `*` - Matches any characters within a single path segment (doesn't match across `/`)
+- `**` - Matches any characters across multiple path segments (includes `/`)
+
+Examples:
+- `/admin/*` matches `/admin/dashboard` but not `/admin/users/list`
+- `/admin/**` matches both `/admin/dashboard` and `/admin/users/list`
+- `/blog/*/comments` matches `/blog/post-123/comments` but not `/blog/category/post/comments`
+
+Example usage:
+```html
+data-skip-patterns='["/admin/**", "/blog/drafts/*", "/preview/**"]'
+data-mask-patterns='["/users/*/settings", "/accounts/**", "/orders/*/details"]'
+```
+
+**Example with multiple options:**
+
+```html
+<script
+ src="https://api.rybbit.io/api/script.js"
+ async
+ data-site-id="456"
+ data-skip-patterns='["/admin/**", "/preview/*"]'
+ data-mask-patterns='["/users/*/profile", "/orders/**"]'
+ data-track-query="false"
+ data-debounce="300"
+></script>
+```
+
diff --git a/docs/src/content/web.mdx b/docs/src/content/sdks/web.mdx
similarity index 100%
rename from docs/src/content/web.mdx
rename to docs/src/content/sdks/web.mdx
diff --git a/docs/src/content/tracker.mdx b/docs/src/content/tracker.mdx
deleted file mode 100644
index 41c0f1077..000000000
--- a/docs/src/content/tracker.mdx
+++ /dev/null
@@ -1,98 +0,0 @@
-# Tracker Configuration
-
-To start tracking user activity on your website, add the Rybbit tracking script to your site's HTML.
-
-## Installation
-The webpage should give you this script tag like this when you first add a website. Place it within the `<head>` section of your website. Include it on every page you wish to track.
-
-```html
-<script src="https://app.rybbit.io/api/script.js" async data-site-id="YOUR_SITE_ID"></script>
-```
-
-If you are self-hosting Rybbit `app.rybbit.io` will be domain of your Rybbit instance.
-
-## Configuration Options
-
-You can customize the script's behavior using `data-*` attributes on the `<script>` tag:
-
-### `data-track-spa`
-
-Set to `"false"` to disable automatic pageview tracking for single page applications (React, Vue, etc). You will need to manually call `window.rybbit.pageview()` or `window.rybbit.track()` for all but the initial pageview.
-
-- **Default:** `"true"`
-- **Example:** `data-track-spa="false"`
-
-### `data-track-query`
-
-Set to `"false"` to disable tracking of URL query strings. This enhances privacy by preventing potentially sensitive information in query parameters (such as session tokens, search queries, or UTM parameters) from being stored in your analytics data.
-
-- **Default:** `"true"`
-- **Example:** `data-track-query="false"`
-
-{/* ### `data-track-outbound`
-
-Set to `"false"` to disable automatic tracking of outbound link clicks. When enabled, the script automatically detects when a user clicks on a link to an external domain and tracks it with an event type of "outbound".
-
-- **Default:** `"true"`
-- **Example:** `data-track-outbound="false"` */}
-
-### `data-skip-patterns`
-
-A JSON string array of URL path patterns to ignore. Pageviews matching these patterns won't be tracked. Supports two types of wildcards:
-
-- `*` - Matches any characters within a single path segment (doesn't match across `/`)
-- `**` - Matches any characters across multiple path segments (includes `/`)
-
-Examples of pattern matching:
-- `/admin/*` matches `/admin/dashboard` but not `/admin/users/list`
-- `/admin/**` matches both `/admin/dashboard` and `/admin/users/list`
-- `/blog/*/comments` matches `/blog/post-123/comments` but not `/blog/category/post/comments`
-- `/blog/**/comments` matches any comments page regardless of path depth
-
-- **Default:** `[]`
-- **Example configuration:**
- ```html
- data-skip-patterns='["/admin/**", "/blog/drafts/*", "/preview/**"]'
- ```
-
-### `data-mask-patterns`
-
-A JSON string array of URL path patterns to mask for privacy. Pageviews matching these patterns will be tracked, but the actual URL path will be replaced with the pattern itself in analytics data.
-
-Supports the same wildcard patterns as `data-skip-patterns`:
-- `*` - Single path segment wildcard
-- `**` - Multi-segment wildcard
-
-Common use cases:
-- Mask user-specific pages: `/users/*/profile` will show as `/users/*/profile` instead of the actual username
-- Mask all product pages: `/products/**` will hide specific product paths
-- Mask order confirmation pages: `/checkout/*/confirmation` will hide order IDs
-
-- **Default:** `[]`
-- **Example configuration:**
- ```html
- data-mask-patterns='["/users/*/settings", "/accounts/**", "/orders/*/details"]'
- ```
-
-### `data-debounce`
-
-The delay (in milliseconds) before tracking a pageview after URL changes via the History API (`pushState`, `replaceState`). Set to `0` to disable debouncing.
-
-- **Default:** `"500"`
-- **Example:** `data-debounce="1000"`
-
-
-**Example with multiple options:**
-
-```html
-<script
- src="https://api.rybbit.io/api/script.js"
- async
- data-site-id="456"
- data-skip-patterns='["/admin/**", "/preview/*"]'
- data-mask-patterns='["/users/*/profile", "/orders/**"]'
- data-track-query="false"
- data-debounce="300"
-></script>
-```
-