📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
added some docs
Blue Mousedb0a84eac93f
diff --git a/docs/add-a-website.md b/docs/add-a-website.mdnew file mode 100644index 000000000..d579f5ed5--- /dev/null+++ b/docs/add-a-website.md@@ -0,0 +1,8 @@+---+title: Hello world+slug: /add-a-website+---++import useBaseUrl from '@docusaurus/useBaseUrl';++This is a test page.diff --git a/docs/add-script.md b/docs/add-script.mdnew file mode 100644index 000000000..c9152454f--- /dev/null+++ b/docs/add-script.md@@ -0,0 +1,68 @@+---+title: Add tracking script to your website+slug: /install-script+---++import useBaseUrl from '@docusaurus/useBaseUrl';++To be able to use Swetrix on your website, you need to add a tracking script to your website and there are several ways on how to do it.++## Edit websites HTML code+The easiest way to add the tracking script to your website is to edit the HTML code of your website.+To do this, paste the following code snippet into the header section (`<head>` tag) of your website:++```html+<script src="https://swetrix.org/swetrix.js" defer></script>+```++After you have added the code snippet, you also have to add the following code snippet into the end of the body section (`<body>` tag) of your website:++```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!+:::++Done. Now you can start using Swetrix on your website.++## Install Swetrix via npm+If you are using a website that is based on a JavaScript framework, for example React or Vue, you can install Swetrix via npm and use it in your website.++To install Swetrix via npm, run the following command in your terminal:++```bash+npm install swetrix+```++Next you should import module into your project's root file (in React it's usually called `index.js` or `App.js`, and these files are located in the `src` folder):++```js+import * as Swetrix from 'swetrix'+```++After you can track anything you want. For example, the following code snippet will work just fine:++```js+Swetrix.init('YOUR_PROJECT_ID')+Swetrix.trackViews()+```++## Integration with CMS or site builders+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 and you can read more detailed information about it [here](integrations).\ No newline at end of filediff --git a/docs/integrations.md b/docs/integrations.mdnew file mode 100644index 000000000..8b825e2f3--- /dev/null+++ b/docs/integrations.md@@ -0,0 +1,8 @@+---+title: Hello world+slug: /integrations+---++import useBaseUrl from '@docusaurus/useBaseUrl';++This is a test page.diff --git a/docs/signup.md b/docs/signup.mdnew file mode 100644index 000000000..62d392c19--- /dev/null+++ b/docs/signup.md@@ -0,0 +1,8 @@+---+title: Hello world+slug: /signup+---++import useBaseUrl from '@docusaurus/useBaseUrl';++This is a test page.diff --git a/sidebars.js b/sidebars.jsindex 47a4269ec..0496984a1 100644--- a/sidebars.js+++ b/sidebars.js@@ -1,5 +1,5 @@module.exports = {docs: {- "Get Started": ['introduction'],+ "Get Started": ['introduction', 'signup', 'add-a-website', 'add-script'],},}