Skip to content

rstackjs/rsbuild-plugin-google-analytics

Repository files navigation

rsbuild-plugin-google-analytics

An Rsbuild plugin to setup Google Analytics in your website.

npm version license

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

License

MIT.

About

An Rsbuild plugin to setup Google Analytics in your website.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •