Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

added integrations

Blue Mousecffd4fa72657
diff --git a/docs/add-script.md b/docs/add-script.md
index c9152454f..0a7fe5926 100644
--- a/docs/add-script.md
+++ b/docs/add-script.md
@@ -35,7 +35,7 @@ After you have added the code snippet, you also have to add the following code s
```
:::caution
-It's very important not to forget to replace `YOUR_PROJECT_ID` with your actual project ID you can find in the Dashboard, otherwise tracking won't work!
+It's very important not to forget to replace `YOUR_PROJECT_ID` with your actual Project ID you can find in the Dashboard, otherwise tracking won't work!
:::
Done. Now you can start using Swetrix on your website.
diff --git a/docs/integration-guides.md b/docs/integration-guides.md
new file mode 100644
index 000000000..5a418a84b
--- /dev/null
+++ b/docs/integration-guides.md
@@ -0,0 +1,21 @@
+---
+title: Integration guides
+slug: /integrations
+---
+
+Sometimes it might be easier to install Swetrix without editing the HTML code of your website and this is the case for some CMS or site builders, for example WordPress or Wix.
+
+We support a variety of different integrations you can use.
+
+## Official integrations
+1. [WordPress](/wordpress-integration)
+2. [Wix](/wix-integration)
+3. [Webflow](/webflow-integration)
+4. [Ghost](/ghost-integration)
+5. [Python Django](/django-integration)
+6. [SvelteKit](/sveltekit-integration)
+7. [Next.js](https://github.com/Swetrix/swetrix-nextjs)
+
+## Unofficial integrations
+1. [Java SDK](https://github.com/Casterlabs/swetrix-java)
+2. [Vue](https://github.com/ansidev/swetrix-vue)
diff --git a/docs/integrations.md b/docs/integrations.md
deleted file mode 100644
index 8b825e2f3..000000000
--- a/docs/integrations.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: Hello world
-slug: /integrations
----
-
-import useBaseUrl from '@docusaurus/useBaseUrl';
-
-This is a test page.
diff --git a/docs/integrations/django.md b/docs/integrations/django.md
new file mode 100644
index 000000000..4b1aebaa0
--- /dev/null
+++ b/docs/integrations/django.md
@@ -0,0 +1,35 @@
+---
+title: Python Django
+slug: /django-integration
+---
+
+After you sign up on Swetrix and create a new project, the only thing left is to add it to your website.
+
+## Installation
+1. Go to your Django website codebase and open up the .html templates folder. You need to add the Swetrix tracking script to the base template which is imported by all other templates via `{% extends 'base.html' %}`.
+2. In the HTML `<head>` section you need to add the following:
+```html
+<script src="https://swetrix.org/swetrix.js" defer></script>
+```
+3. In the `<body>` section you need to add the following:
+```html
+<script>
+ document.addEventListener('DOMContentLoaded', function () {
+ swetrix.init('YOUR_PROJECT_ID')
+ swetrix.trackViews()
+ })
+</script>
+
+<noscript>
+ <img src="https://api.swetrix.com/log/noscript?pid=YOUR_PROJECT_ID" alt="" referrerpolicy="no-referrer-when-downgrade" />
+</noscript>
+```
+
+:::caution
+It's very important not to forget to replace `YOUR_PROJECT_ID` with your actual Project ID you can find in the Dashboard, otherwise tracking won't work!
+:::
+
+## Check your installation
+After installing Swetrix tracking script, go to your website and visit some pages.
+
+Within a minute you should be able to see new pageviews being added to your project's dahsboard.
diff --git a/docs/integrations/ghost.md b/docs/integrations/ghost.md
new file mode 100644
index 000000000..5eefe833e
--- /dev/null
+++ b/docs/integrations/ghost.md
@@ -0,0 +1,38 @@
+---
+title: Ghost
+slug: /ghost-integration
+---
+
+After you sign up on Swetrix and create a new project, the only thing left is to add it to your website.
+
+## Installation
+1. Log in to your Ghost admin account.
+2. Open `Settings`, go to the `Code Injection` section.
+
+3. To the `Site Header` section you need to add the following:
+```html
+<script src="https://swetrix.org/swetrix.js" defer></script>
+```
+
+5. In the `Site Footer` section you need to add the following:
+```html
+<script>
+ document.addEventListener('DOMContentLoaded', function () {
+ swetrix.init('YOUR_PROJECT_ID')
+ swetrix.trackViews()
+ })
+</script>
+
+<noscript>
+ <img src="https://api.swetrix.com/log/noscript?pid=YOUR_PROJECT_ID" alt="" referrerpolicy="no-referrer-when-downgrade" />
+</noscript>
+```
+
+:::caution
+It's very important not to forget to replace `YOUR_PROJECT_ID` with your actual Project ID you can find in the Dashboard, otherwise tracking won't work!
+:::
+
+## Check your installation
+After installing Swetrix tracking script, go to your website and visit some pages.
+
+Within a minute you should be able to see new pageviews being added to your project's dahsboard.
diff --git a/docs/integrations/sveltekit.md b/docs/integrations/sveltekit.md
new file mode 100644
index 000000000..e80b7877e
--- /dev/null
+++ b/docs/integrations/sveltekit.md
@@ -0,0 +1,41 @@
+---
+title: SvelteKit
+slug: /sveltekit-integration
+---
+
+After you sign up on Swetrix and create a new project, the only thing left is to add it to your website.
+
+## Installation
+1. Install the Swetrix package via `npm install swetrix`.
+2. Go to your SvelteKit website codebase and either create a new `__layout.svelte` file or use an existing one.
+3. Make your layout file look like this:
+```html
+<script>
+ import { onMount } from "svelte";
+ import { browser, dev } from "$app/env";
+ import { page } from "$app/stores";
+ import * as Swetrix from "swetrix";
+
+ onMount(() => {
+ Swetrix.init("YOUR_PROJECT_ID");
+ Swetrix.trackViews();
+ });
+
+ // Trigger a pageview everytime the user navigates.
+ // We use the `browser` env variable to ensure that we don't try to
+ // call trackViews while the component is doing SSR.
+ $: $page.url.pathname, browser && Swetrix.trackViews();
+</script>
+
+<!-- Your site's content gets injected here -->
+<slot />
+```
+
+:::caution
+It's very important not to forget to replace `YOUR_PROJECT_ID` with your actual Project ID you can find in the Dashboard, otherwise tracking won't work!
+:::
+
+## Check your installation
+After installing Swetrix tracking script, go to your website and visit some pages.
+
+Within a minute you should be able to see new pageviews being added to your project's dahsboard.
diff --git a/docs/integrations/webflow.md b/docs/integrations/webflow.md
new file mode 100644
index 000000000..62e3b766c
--- /dev/null
+++ b/docs/integrations/webflow.md
@@ -0,0 +1,46 @@
+---
+title: Webflow
+slug: /webflow-integration
+---
+
+import useBaseUrl from '@docusaurus/useBaseUrl';
+
+After you sign up on Swetrix and create a new project, the only thing left is to add it to your website.
+
+## Installation
+1. Log in to your Webflow account.
+
+2. Open up your project, go to the `Project Settings > Custom Code` section:
+<img alt="Webflow screenshot" src={useBaseUrl('img/webflow-int.png')} />
+
+3. In the `Head code` section you need to add the following:
+```html
+<script src="https://swetrix.org/swetrix.js" defer></script>
+```
+
+4. In the `Footer code` section you need to add the following:
+```html
+<script>
+ document.addEventListener('DOMContentLoaded', function () {
+ swetrix.init('YOUR_PROJECT_ID')
+ swetrix.trackViews()
+ })
+</script>
+
+<noscript>
+ <img src="https://api.swetrix.com/log/noscript?pid=YOUR_PROJECT_ID" alt="" referrerpolicy="no-referrer-when-downgrade" />
+</noscript>
+```
+
+:::caution
+It's very important not to forget to replace `YOUR_PROJECT_ID` with your actual Project ID you can find in the Dashboard, otherwise tracking won't work!
+:::
+
+## Check your installation
+After installing Swetrix tracking script, go to your website and visit some pages.
+
+Within a minute you should be able to see new pageviews being added to your project's dahsboard.
+
+:::info
+Custom scripts will only appear on the published Webflow site.
+:::
\ No newline at end of file
diff --git a/docs/integrations/wix.md b/docs/integrations/wix.md
new file mode 100644
index 000000000..a3c12f9d2
--- /dev/null
+++ b/docs/integrations/wix.md
@@ -0,0 +1,44 @@
+---
+title: Wix
+slug: /wix-integration
+---
+
+After you sign up on Swetrix and create a new project, the only thing left is to add it to your website.
+
+## Installation
+1. Log in to your Wix account.
+2. Go to the Settings page on your Wix site dashboard.
+3. Click on the `Custom Code` tab under `Advanced Settings`.
+4. Click on Add `Custom Code` at the top right.
+5. Paste the following Swetrix snippet:
+```html
+<script src="https://swetrix.org/swetrix.js" defer></script>
+```
+6. Give it a name so that you can easily recognize this snippet later.
+7. Select `All pages` under "Add Code to Pages" to track all pages on your website. Leave the default option Load once if asked.
+8. Select `Head` when asked where to place the code snippet.
+9. Click `Apply`.
+10. Repeat all the steps above, but this time paste the following script:
+```html
+<script>
+ document.addEventListener('DOMContentLoaded', function () {
+ swetrix.init('YOUR_PROJECT_ID')
+ swetrix.trackViews()
+ })
+</script>
+
+<noscript>
+ <img src="https://api.swetrix.com/log/noscript?pid=YOUR_PROJECT_ID" alt="" referrerpolicy="no-referrer-when-downgrade" />
+</noscript>
+```
+10. Select `Body - end` when asked where to place the code snippet.
+10. Click `Apply` again, and done!
+
+:::caution
+It's very important not to forget to replace `YOUR_PROJECT_ID` with your actual Project ID you can find in the Dashboard, otherwise tracking won't work!
+:::
+
+## Check your installation
+After installing Swetrix tracking script, go to your website and visit some pages.
+
+Within a minute you should be able to see new pageviews being added to your project's dahsboard.
\ No newline at end of file
diff --git a/docs/integrations/wordpress.md b/docs/integrations/wordpress.md
new file mode 100644
index 000000000..a8cc76f65
--- /dev/null
+++ b/docs/integrations/wordpress.md
@@ -0,0 +1,39 @@
+---
+title: Wordpress
+slug: /wordpress-integration
+---
+
+After you sign up on Swetrix and create a new project, the only thing left is to add it to your website.
+
+## Installation
+1. Log in to your Wordpress account.
+2. Install a plugin for adding the code to your HTML, for instance the [Insert Headers and Footers plugin](https://wordpress.org/plugins/insert-headers-and-footers).
+3. Open up your project, go to the `Project Settings > Custom Code` section.
+
+4. To the `Scripts in Header` section you need to add the following:
+```html
+<script src="https://swetrix.org/swetrix.js" defer></script>
+```
+
+1. In the `Scripts in Footer` section you need to add the following:
+```html
+<script>
+ document.addEventListener('DOMContentLoaded', function () {
+ swetrix.init('YOUR_PROJECT_ID')
+ swetrix.trackViews()
+ })
+</script>
+
+<noscript>
+ <img src="https://api.swetrix.com/log/noscript?pid=YOUR_PROJECT_ID" alt="" referrerpolicy="no-referrer-when-downgrade" />
+</noscript>
+```
+
+:::caution
+It's very important not to forget to replace `YOUR_PROJECT_ID` with your actual Project ID you can find in the Dashboard, otherwise tracking won't work!
+:::
+
+## Check your installation
+After installing Swetrix tracking script, go to your website and visit some pages.
+
+Within a minute you should be able to see new pageviews being added to your project's dahsboard.
diff --git a/sidebars.js b/sidebars.js
index 545e74ee1..e3ed21da5 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -1,5 +1,15 @@
module.exports = {
docs: {
- "Get Started": ['introduction', 'add-script', 'script-reference'],
+ "Get Started": [
+ 'introduction',
+ 'add-script',
+ 'script-reference',
+ 'integration-guides',
+ {
+ type: 'category',
+ label: 'Integrations',
+ items: ['integrations/wordpress', 'integrations/webflow', 'integrations/wix', 'integrations/ghost', 'integrations/django', 'integrations/sveltekit'],
+ }
+ ],
},
}
diff --git a/static/img/webflow-int.png b/static/img/webflow-int.png
new file mode 100644
index 000000000..edb06835d
Binary files /dev/null and b/static/img/webflow-int.png differ