Skip to content

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

Fix review comments: remove circular reference and update rybbit.event to window.rybbit.event

copilot-swe-agent[bot]afbdc486fae1
diff --git a/docs/content/blog/churn-rate-vs-retention-rate.mdx b/docs/content/blog/churn-rate-vs-retention-rate.mdx
index d02425737..8cc07a528 100644
--- a/docs/content/blog/churn-rate-vs-retention-rate.mdx
+++ b/docs/content/blog/churn-rate-vs-retention-rate.mdx
@@ -203,7 +203,7 @@ Use Rybbit's event tracking to capture this:
```javascript
// When a customer cancels their subscription
-rybbit.event("Churn", {
+window.rybbit.event("Churn", {
reason: "subscription_cancelled",
customer_lifetime_days: 180,
mrr_lost: 99,
@@ -211,7 +211,7 @@ rybbit.event("Churn", {
});
// Or when they haven't been active in 30 days
-rybbit.event("Churn", {
+window.rybbit.event("Churn", {
reason: "inactivity",
days_inactive: 30,
customer_lifetime_days: 45
@@ -239,24 +239,24 @@ Example:
```javascript
// User takes a meaningful action
-rybbit.event("Feature_Usage", {
+window.rybbit.event("Feature_Usage", {
feature_name: "advanced_reporting",
user_signup_cohort: "2025-10"
});
// Track weekly active users
-rybbit.event("Weekly_Active", {
+window.rybbit.event("Weekly_Active", {
days_since_signup: 7,
signup_month: "2025-10"
});
// Track 30-day and 90-day retention markers
-rybbit.event("Milestone_Reached", {
+window.rybbit.event("Milestone_Reached", {
milestone_type: "30_day_user",
signup_month: "2025-10"
});
-rybbit.event("Milestone_Reached", {
+window.rybbit.event("Milestone_Reached", {
milestone_type: "90_day_user",
signup_month: "2025-10"
});
@@ -302,19 +302,19 @@ Let's say you're running a project management tool:
**Week 1 After Signup:**
```javascript
// Day 1: User signs up
-rybbit.event("Account_Created", {
+window.rybbit.event("Account_Created", {
plan_type: "free",
signup_source: "organic"
});
// Day 3: User creates first project
-rybbit.event("Feature_Used", {
+window.rybbit.event("Feature_Used", {
feature: "create_project",
days_active: 3
});
// Day 7: Still using the app
-rybbit.event("Retention_Day7", {
+window.rybbit.event("Retention_Day7", {
active: true,
sessions: 4,
projects_created: 2
@@ -324,7 +324,7 @@ rybbit.event("Retention_Day7", {
**Month 1:**
```javascript
// Day 30: User still active
-rybbit.event("Retention_Day30", {
+window.rybbit.event("Retention_Day30", {
active: true,
sessions: 12,
projects_created: 4,
@@ -335,14 +335,14 @@ rybbit.event("Retention_Day30", {
**Month 3:**
```javascript
// If they upgraded, they're retained
-rybbit.event("Plan_Upgraded", {
+window.rybbit.event("Plan_Upgraded", {
from_plan: "free",
to_plan: "professional",
days_to_upgrade: 45
});
// If they're inactive
-rybbit.event("Churn", {
+window.rybbit.event("Churn", {
reason: "inactivity",
days_active: 31
});
diff --git a/docs/content/blog/ecommerce-analytics.mdx b/docs/content/blog/ecommerce-analytics.mdx
index aa2808dd1..25f713065 100644
--- a/docs/content/blog/ecommerce-analytics.mdx
+++ b/docs/content/blog/ecommerce-analytics.mdx
@@ -61,7 +61,7 @@ While Rybbit automatically tracks page views, you'll want to track key e-commerc
Here's how you track a purchase:
```javascript
-rybbit.event("Purchase", {
+window.rybbit.event("Purchase", {
value: orderTotal,
currency: "USD",
transaction_id: orderId,
@@ -266,13 +266,13 @@ Track repeat purchases to understand customer lifetime value:
```javascript
// Track first purchase
-rybbit.event("First Purchase", {
+window.rybbit.event("First Purchase", {
value: orderTotal,
customer_id: customerId,
});
// Track repeat purchases
-rybbit.event("Repeat Purchase", {
+window.rybbit.event("Repeat Purchase", {
value: orderTotal,
customer_id: customerId,
purchase_count: totalPurchases,
@@ -285,18 +285,18 @@ Track when users add items to cart but don't complete checkout:
```javascript
// Add to cart
-rybbit.event("Add to Cart", {
+window.rybbit.event("Add to Cart", {
product_id: productId,
value: productPrice,
});
// Checkout started
-rybbit.event("Checkout Started", {
+window.rybbit.event("Checkout Started", {
cart_value: totalValue,
});
// Purchase completed (or not)
-rybbit.event("Purchase", {
+window.rybbit.event("Purchase", {
value: orderTotal,
});
```
@@ -308,7 +308,7 @@ By tracking these events, you can calculate your cart abandonment rate and work
Track which product categories perform best:
```javascript
-rybbit.event("Product View", {
+window.rybbit.event("Product View", {
category: "Electronics",
subcategory: "Headphones",
product_id: productId,
diff --git a/docs/content/docs/self-hosting-guides/custom-nginx.mdx b/docs/content/docs/self-hosting-guides/custom-nginx.mdx
index 1509b57b2..d8c3e7a76 100644
--- a/docs/content/docs/self-hosting-guides/custom-nginx.mdx
+++ b/docs/content/docs/self-hosting-guides/custom-nginx.mdx
@@ -242,8 +242,4 @@ sudo tail -f /var/log/nginx/error.log
# Rybbit logs
docker compose logs -f
-```
-
-<Callout type="info">
-For step-by-step Nginx installation and SSL setup, see our [Nginx Setup Guide](/docs/self-hosting-guides/custom-nginx).
-</Callout>
\ No newline at end of file
+```
\ No newline at end of file