Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rspack-contrib/rsbuild-plugin-google-analytics
An Rsbuild plugin to setup Google Analytics in your website.
https://github.com/rspack-contrib/rsbuild-plugin-google-analytics
rsbuild rsbuild-plugin rspack
Last synced: 16 days ago
JSON representation
An Rsbuild plugin to setup Google Analytics in your website.
- Host: GitHub
- URL: https://github.com/rspack-contrib/rsbuild-plugin-google-analytics
- Owner: rspack-contrib
- License: mit
- Created: 2024-03-24T02:24:28.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-12-01T01:34:31.000Z (26 days ago)
- Last Synced: 2024-12-01T02:26:32.874Z (26 days ago)
- Topics: rsbuild, rsbuild-plugin, rspack
- Language: TypeScript
- Homepage:
- Size: 90.8 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rspack - rsbuild-plugin-google-analytics
README
# rsbuild-plugin-google-analytics
An Rsbuild plugin to setup Google Analytics in your website.
## Usage
Install:
```bash
npm add rsbuild-plugin-google-analytics -D
```Add plugin to your `rsbuild.config.ts`:
```ts
// rsbuild.config.ts
import { pluginGoogleAnalytics } from 'rsbuild-plugin-google-analytics';export default {
plugins: [
pluginGoogleAnalytics({
// replace this with your Google tag ID
// see: https://support.google.com/analytics/answer/9539598?hl=en
id: 'G-xxxxxxxxxx',
}),
],
};
```## Options
Here are the available options:
| Name | Type | Description | Defaults |
| ------ | --------- | ---------------------------------- | ----------- |
| id | `string` | Google tag ID | `undefined` |
| enable | `boolean` | Whether to enable Google Analytics | `true` |## License
[MIT](./LICENSE).