Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        

# rsbuild-plugin-google-analytics

An Rsbuild plugin to setup Google Analytics in your website.



npm version

license
downloads

## 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).