Git Product home page Git Product logo

Comments (4)

ianstormtaylor avatar ianstormtaylor commented on July 4, 2024

We actually have two helper methods for track called trackLink and trackForm. We just put up some documentation about them here: https://segment.io/libraries/analytics.js#trackLink They'll insert a small timeout that gives the events time to fire before the page unloads. So you shouldn't need to use the synchronous call there anymore (and you still get a nice clean API for it).

If you're using Segment.io, you'll need to update your snippet so that the two methods are available to you.

Cheers

from analytics.js.

rantav avatar rantav commented on July 4, 2024

You might want to add trackClose or trackNavAway, which also add a small timeout before they allow closure or nav away to allow enough time for event tracking.
And even if their implementation is just the same as trackLink or trackForm, it's still semantically cleaner.

from analytics.js.

ianstormtaylor avatar ianstormtaylor commented on July 4, 2024

trackClose is interesting. Which events do you want to track then? And how is that different than trackNavAway?

from analytics.js.

rantav avatar rantav commented on July 4, 2024

trackClose and trackNavAway are the same, it's just two different names
that came to mind.
My use case is that I have a video show and during the show I send tracking
events to see which segments were watched or not. But I also want to know
if a user leaves in the middle of the show, in the middle of a segment -
when did she leave exactly? So I want to send an event when she either
closes the browser tab or navigates away to a different site.

On Mon, Jan 28, 2013 at 8:58 AM, Ian Storm Taylor
[email protected]:

trackClose is interesting. Which events do you want to track then? And
how is that different than trackNavAway?


Reply to this email directly or view it on GitHubhttps://github.com//issues/50#issuecomment-12770551.

/Ran
http://tavory.com

from analytics.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.