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!

updated docs

Blue Mousedcb6651235f3
diff --git a/docs/add-script.md b/docs/add-script.md
index 0a7fe5926..7124d85ab 100644
--- a/docs/add-script.md
+++ b/docs/add-script.md
@@ -5,19 +5,14 @@ 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.
+To use Swetrix on your website, you need to add a tracking script to your website and there are several ways to do this.
-## Edit websites HTML code
+## Edit the website's 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:
+To do this, paste the following code snippet into the Body section (`<body>` tag). You have to place the script within the `<body>...</body>` tags.
```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')
@@ -35,27 +30,27 @@ 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 important to remember to replace `YOUR_PROJECT_ID` with your actual Project ID, which you can find in the Dashboard, otherwise tracking will not 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.
+If you are using a website based on a JavaScript framework such as React or Vue, you can install Swetrix via npm and use it on your website.
-To install Swetrix via npm, run the following command in your terminal:
+To install Swetrix using 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):
+Next, you should import the module into your project's root file (in React this is 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:
+After that you can track anything you want. For example, the following code snippet will work just fine:
```js
Swetrix.init('YOUR_PROJECT_ID')
@@ -63,6 +58,6 @@ 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.
+Sometimes it may be easier to install Swetrix without editing the HTML code of your website and this is the case with 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 file
+We support a number of different integrations and you can read more about them [here](integrations).