rsbuild-plugin-google-analytics
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

rsbuild-plugin-google-analytics

An Rsbuild plugin to setup Google Analytics in your website.

npm version license downloads

Usage

Install:

npm add rsbuild-plugin-google-analytics -D

Add plugin to your rsbuild.config.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.

Readme

Keywords

none

Package Sidebar

Install

npm i rsbuild-plugin-google-analytics

Weekly Downloads

3,379

Version

1.0.3

License

MIT

Unpacked Size

7.4 kB

Total Files

7

Last publish

Collaborators

  • chenjiahan