benjaminhoffman / gatsby-plugin-segment-js

Gatsby plugin for segment.com's analytic.js snippet
https://www.npmjs.com/package/gatsby-plugin-segment-js
MIT License
40 stars 28 forks source link

Add delay option to page tracking call #35

Closed sreucherand closed 4 years ago

sreucherand commented 4 years ago

Hi there,

Following this PR, I wanna have the ability to configure the delay applied to the page tracking call. Seems that sometimes, 50ms is not enough on my side so the tracking vs page update is not synced properly. I think it'd be better to let the user be able to set the delay that fits him the most than bumping it up.

benjaminhoffman commented 4 years ago

did you see this btw? https://github.com/benjaminhoffman/gatsby-plugin-segment-js/pull/34

sreucherand commented 4 years ago

I did, but seems to me that it describes a different use case, where the delay applies to the initial load of Segment instead of the page tracking event applied at every route change like I need.

I will update the comment per you reply.

benjaminhoffman commented 4 years ago

@TomPridham thoughts on this? i understand the use case but goes to what i was saying few days ago about setting bloat. maybe it's inevitable tho.

TomPridham commented 4 years ago

i think this could be useful, and it's a fairly minimal change

sreucherand commented 4 years ago

@TomPridham I've made the updates and resolved the conflicts, all clear.

TomPridham commented 4 years ago

just published @sreucherand