Git Product home page Git Product logo

Comments (5)

benjaminhoffman avatar benjaminhoffman commented on August 16, 2024

@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.

Kilian avatar Kilian commented on August 16, 2024

Are you doing anything custom with your routing or in your gatsby-browser.js?

from gatsby-plugin-segment-js.

chriswhong avatar chriswhong commented on August 16, 2024

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.

bwlng avatar bwlng commented on August 16, 2024

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.

benjaminhoffman avatar benjaminhoffman commented on August 16, 2024

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!

cc @bwlng @chriswhong @Kilian

from gatsby-plugin-segment-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.