Comments (5)
@chriswhong this is an interesting observation. this could potentially be an issue. personally i haven't experienced this but i also have never used the delayLoad
. will ask around.
from gatsby-plugin-segment-js.
Are you doing anything custom with your routing or in your gatsby-browser.js?
from gatsby-plugin-segment-js.
I don't think so. Here's my site's source code if anyone wants to clone and try to reproduce. We ended up using gatsby-plugin-segment-analytics
from gatsby-plugin-segment-js.
I’ve seen the same issue on my site. Segment's debug tool always shows the previous page’s info when using onRouteUpdate
in gatsby-browser.js
to call window.analytics.page()
on pages visited after the initial page load.
The location
object available via onRouteUpdate
does have the correct page info, but there must be a race condition where Segment's tracking is handled before the page/DOM are actually updated. In my tests, delaying the analytics call by 1 second when the route updates works around the issue. I haven't seen a Gatsby API that would be a better fit than onRouteUpdate
.
Did you find a more reliable solution?
from gatsby-plugin-segment-js.
super excited to announce, this issue is fixed! hat tip to @TomPridham. solved via #30
issue is now closed. please upgrade your version of this plugin to v3.3.0
and definitely let us know if you are still experiencing any issues!
from gatsby-plugin-segment-js.
Related Issues (20)
- Not receiving tracking events HOT 3
- `page()` does not capture correct path if site uses `canonical` link tag HOT 7
- Question: where does `{ trackPage }` come from? HOT 2
- Cannot read property 'track' of undefined HOT 8
- No automatic Identify User calls for anonymous visitors HOT 2
- Can I write code to go in analytics.ready()? HOT 4
- Segment JS snippet link returns 404 HOT 2
- page tracking not fired on initial page load HOT 3
- Delayed loading issue HOT 1
- Commit Adding host option (#21) not published in npm HOT 1
- Update your changelog HOT 1
- linting and formatting HOT 2
- Change functionality of delayLoad? HOT 4
- Peer dependancy Gatsby 4.0? HOT 2
- Will this plugin support segment 2.0? HOT 6
- Double page tracking via gatsby-ssr.js and gatsby-browser .js HOT 5
- Not Compatible with Gatsby 5 HOT 4
- Unexpected identifier 'window' HOT 7
- delayLoad and delayLoadTime did not work HOT 11
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 gatsby-plugin-segment-js.