docs: add framework support document

This commit is contained in:
moonrailgun 2024-03-03 17:05:46 +08:00
parent d8b23a7468
commit 18027170b8
3 changed files with 33 additions and 3 deletions

View File

@ -0,0 +1,4 @@
{
"label": "Framework",
"position": 2
}

View File

@ -0,0 +1,26 @@
---
sidebar_position: 1
---
# Use in Docusaurus
In `docusaurus.config.js`:
```js
/** @type {import('@docusaurus/types').Config} */
const config = {
// ...
scripts: [
{
src: 'https://<your domain>/tracker.js',
async: true,
defer: true,
'data-website-id': '<your-website-id>',
},
],
};
module.exports = config;
```

View File

@ -14,13 +14,13 @@ the script look like below:
<script async defer src="https://<your-self-hosted-domain>/tracker.js" data-website-id="xxxxxxxxxxxxx"></script> <script async defer src="https://<your-self-hosted-domain>/tracker.js" data-website-id="xxxxxxxxxxxxx"></script>
``` ```
you can get this script code from your tianji website list you can get this script code from your **Tianji** website list
## Report Event ## Report Event
Tianji provide a simple way to report user click event, its easy to help you track which action user like and often to use. **Tianji** provide a simple way to report user click event, its easy to help you track which action user like and often to use.
This is a very common method in website analysis. You can use it quickly get it by using tianji. This is a very common method in website analysis. You can use it quickly get it by using **Tianji**.
After you inject script code into your website, you just need add a `data-tianji-event` in dom attribute. After you inject script code into your website, you just need add a `data-tianji-event` in dom attribute.