Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async initial check #1393

Open
drphrozen opened this issue Nov 25, 2024 · 1 comment
Open

Async initial check #1393

drphrozen opened this issue Nov 25, 2024 · 1 comment
Labels
type:enhancement New features or improvements to existing features.

Comments

@drphrozen
Copy link

Is your feature request related to a problem? Please describe.
We need to ensure which country the request originates from before tracking is enabled. This is done using a server side check.
The issue we are facing is that we want to start collecting events as soon as possible, but if the response from the server is delayed then we might miss some initial tracking calls.

Describe the solution you'd like
Ideally we should be able to enable the tracking but be able to postpone sending the events. Based on the response we would either send off the and return to normal tracking or drop the events and disable the tracker.

Describe alternatives you've considered

  • Creating custom event emitter - we could have a lot more control over how events are sent and if they are saved in the events store - emitter is async in it’s nature so it would be really easy to hook into a pipeline with our allowed countries check
  • custom events store - we can block events from being retrieved from a store by creating our own custom implementation. Drawback is that in my opinion the event store should be a “dumb” component and shouldn’t be used to decide whether we can track or not.
    Additionally we still need to block events that are to big for an events store - either with do not track cookie either with custom fetch

Additional context

@drphrozen drphrozen added the type:enhancement New features or improvements to existing features. label Nov 25, 2024
@miike
Copy link
Contributor

miike commented Nov 25, 2024

Hi @drphrozen

Is this for compliance reasons or is there something else inherent in the returned country as to why you'd like this behaviour?

One option is to enable a larger buffer size (e.g., 1000 events) which will result in the buffer not being sent until it is either explicitly flushed (which you could do when your country check returns) and then reduce the buffer size back down to a desired number (e.g., 1).

I'd caution against doing this for certain compliance reasons however as in certain instances (i.e., ePrivacy, GDPR) it is not possible to do so without explicit consent and it is not possible for that consent to be made retrospective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New features or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

2 participants