Comments (2)
I don't see window.Analytics
on the global window on https://lovemyvoice.app/
For the gatsby route plugin to work you need to set analytics to the window.
/* analytics.js */
import Analytics from 'analytics'
import segmentPlugin from 'analytics-plugin-segment'
import gtagManagerPlugin from 'analytics-plugin-google-tag-manager'
// ... whatever analytics provider you use
const analytics = Analytics({
plugins: [
gtagManagerPlugin({
containerId: 'GTM-XYZ'
}),
segmentPlugin({
writeKey: '123567',
}),
]
})
// Set to global so analytics plugin will work with Gatsby
if (typeof window !== 'undefined') {
window.Analytics = analytics
}
// Set to window.
window.Analytics = analytics
Alternatively, you can use a standalone routeChange
utility https://github.com/DavidWells/analytics/blob/master/examples/react/src/index.js#L12 to avoid exposing to the global window
from analytics.
Sorry, I needed to deploy some working solution there. Ended up with a combination of gatsby-plugin-google-analytics
along with a direct Firebase Analytics module (still deciding which one to keep). Both of those are working correctly, but the analytics
module wasn't for some reason.
I guess I will close it here now. Thanks for the reply.
from analytics.
Related Issues (20)
- Request an analytics integration HOT 1
- Plugin Request: AWS Personalize HOT 1
- @analytics/snowplow not working HOT 1
- Remove user_id as a custom dimension in google-analytics event payload
- Angular warns about using "dlv" – can cause optimization bailouts HOT 2
- Allow URL params for simpleanalytics HOT 2
- Request to upgrade analytics-node to resolve security issue in Axios HOT 2
- Update intercom-client in analytics-plugin-intercom
- Add support for Rudderstack HOT 1
- ga4 support for other protocols HOT 1
- Plugin Request - Server-side Implementation - Google Analytics HOT 3
- Clients throwing error: abort is not a function HOT 6
- Dependency Security: Axios Cross-Site Request Forgery Vulnerability HOT 1
- new Chrome cookie policy warning HOT 1
- OneTrust integration HOT 2
- Google Consent Mode v2 HOT 3
- Google Tag Manager - Consent Mode V2 implementation (Next.js 14)
- Customerio Plugin uses customerio-node v0.5.0
- How to contribute a plugin? HOT 1
- Unloading Plugins based on Path HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics.