Code Monkey home page Code Monkey logo

Comments (5)

JeroenBakker avatar JeroenBakker commented on August 21, 2024 1

Oh I see now, it's not that it wasn't being activated, it's just that all page and track calls had already been processed by the time that I had activated the debug mode and it's no longer being maintained between page refreshes.

This does make it rather tricky to debug page calls since they will inevitably have been processed by the time I can enable the debug mode on a page, but that's just a matter of ergonomics and not a bug as I assumed it was.

However, the case with the debug mode that won't turn off after updating to analytics-next does seem to be real.
This can be reproduced on segment.com by manually setting the relevant localstorage entry:

localStorage.setItem('debug', 'analytics:*')

If debug mode was enabled by the old analytics library this will still have been set, and analytics-next still seems to process this in some way.
The output is styled like the old debug mode, but it lacks the more detailed debug messages: (screenshot is from another site)
CleanShot 2021-10-14 at 10 50 53@2x

from analytics-next.

danieljackins avatar danieljackins commented on August 21, 2024

Hi @JeroenBakker, thanks for opening the issue.

Debug mode can be enabled by calling analytics.debug(true).

For the second point, I don't believe this should be an issue because the old analytics library keeps track of debug mode using localstorage, while analytics-next keeps track of it on the analytics object itself.

from analytics-next.

JeroenBakker avatar JeroenBakker commented on August 21, 2024

I've also tried using analytics.debug(true) and it didn't work for me.
I didn't mention it since the documention only says analytics.debug().

Are you saying that debug mode does work for you on segment.com, and that this issue is specific to me?

And I would have expected analytics-next to use something like localstorage to maintain the debug mode between page refreshes, the documentation still says to "Refresh the page after you invoke debug to see the messages"

from analytics-next.

danieljackins avatar danieljackins commented on August 21, 2024

Thanks for pointing out the documentation, I'll get that updated.

Debug mode does work for me on segment.com, here's an example (don't refresh):
image

from analytics-next.

danieljackins avatar danieljackins commented on August 21, 2024

Got it, thanks. Looks like our integrations are using the old debug method. I will push out a fix for disabling that.

As for the debugging page calls, I would recommend adding the debug call to the snippet if needed.

from analytics-next.

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.