
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@analytics/google-tag-manager
Advanced tools
analytics
Note: This package has moved to @analytics/google-tag-manager
Integration with google tag manager for analytics
For more information see the docs.
Install analytics
and @analytics/google-tag-manager
packages
npm install analytics @analytics/google-tag-manager
Import and initialize in project
import Analytics from 'analytics'
import googleTagManager from '@analytics/google-tag-manager'
const analytics = Analytics({
app: 'awesome-app',
plugins: [
googleTagManager({
containerId: 'GTM-123xyz',
})
// ... other plugins
]
})
/* Track page views */
analytics.page()
/* Track custom events */
analytics.track('buttonClicked')
/* Identify visitors */
analytics.identify('user-xzy-123', {
name: 'Bill Murray',
cool: true
})
Make sure you have your google tags manager setup to fire on Page views.
If you are using a SPA you want to listen to history changes as well.
Arguments
object
- Plugin settingsstring
- The Container ID uniquely identifies the GTM Container.Example
googleTagManager({
containerId: 'GTM-123xyz'
})
See the full list of analytics provider plugins in the main repo.
FAQs
Google tag manager plugin for 'analytics' module
The npm package @analytics/google-tag-manager receives a total of 23,453 weekly downloads. As such, @analytics/google-tag-manager popularity was classified as popular.
We found that @analytics/google-tag-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.