ga4-webpack-plugin weekly downloads statistics
By jxmked · npm · Webpack plugins
Injecting Google snippet into HTML for Analytics
ga4-webpack-plugin has 4 recorded weekly downloads on npm, a decrease of 80.0% over the past 30 days, ranking #3240 of 3,247 tracked listings.
About ga4-webpack-plugin
ga4-webpack-plugin
The ga4-webpack-plugin simplifies injecting the Google Analytics 4 (GA4) snippet into your HTML using Webpack.
Install
Install the plugin via npm: npm i --save-dev ga4-webpack-plugin
Setup
Add the plugin to your webpack configuration:
// webpack.config.js
const GA4WebpackPlugin = require('ga4-webpack-plugin');
module.exports = {
// ... other webpack configuration options
plugins: [
new GA4WebpackPlugin({
// Your GA4 Measurement ID (required)
id: "GA_MEASUREMENT_ID",
// Whether to inject the GA4 snippet into HTML (default: true)
inject: true,
// Automatically trigger a page view on load (default: true)
callPageView: true,
// Show log
showLog: false,
// Parameters that will pass to gtag("config", ID, <HERE>)
param: {
"application_version": "v1.2.3" // example
}
})
]
}
Note: Ensure you replace "GA_MEASUREMENT_ID" with your actual GA4 Measurement ID.
The script will be injected before your head tag closing.
Injected HTML
The plugin injects the following code into your HTML:
<!-- Google Analytics 4 (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
Optionally, you can enable callPageView: true in the plugin options to automatically trigger the page view. This adds:
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
to your injected code.
Social
Description from the npm listing.
- ga4
- webpack-plugin
- plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Webpack plugins plugins
All 20 ga4-webpack-plugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/ga4-webpack-plugin. First seen Oct 16, 2026; last successful collection Nov 21, 2026. See the methodology.