Skip to content

Change default method to POST in emitter #289

Description

As we have been doing on other trackers, we should also move to POST as the default method for making requests to the Collector.

I think there is one thing to consider before we do that: If using GET, the behaviour is intuitive – an event is sent right after it is tracked. If we move to POST with default buffer size 10, users might get confused because the tracker won't send any events if they track less than 10 events unless they call flush(). Also, since we only have an in-memory event queue, some events may get lost of users are not aware of the buffering. I can see several options on how to make this experience less confusing for users:

  1. Set the default buffer size to 1
  2. Document better that one needs to call flush when they want to see events sent to the collector and also before closing their app
  3. Add a timer to the emitter that automatically flushes the events after some time (similar like mobile trackers but I don't think that this pattern is suitable for server-side apps)

I think that we should go with option 1 as that is the most intuitive when users are starting with the tracker. We should also document better how to make use of the buffer and how to call the flush. Opening this for discussion if there are other opinions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions