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

Displaying Queued Events? (feature request) #23

Open
ScottyMJacobson opened this issue Mar 11, 2019 · 1 comment
Open

Displaying Queued Events? (feature request) #23

ScottyMJacobson opened this issue Mar 11, 2019 · 1 comment

Comments

@ScottyMJacobson
Copy link

ScottyMJacobson commented Mar 11, 2019

Hi all!

We're batching POST requests in batches of 10 and then using a beacon config to send them. One of the issues with QAing this setup is that there's a lag between tracking the event and the event appearing in the snowplow debug panel (since no network request has gone out yet, we need to wait until there's been multiple-of-10 events tracked before we can debug our events. This often results in me sending a bunch of dummy events to hit that multiple-of-10 number.)

I was thinking this feature could add events that are "queued" (perhaps in "outline" text formatting, a gray background, or some similar visual indication that they haven't been sent yet) to the events list on the left. I haven't developed much in Chrome extensions, but with a bit of preliminary digging it looks like this would mean overriding localstorage from a content script within the window, and then communicating changes to localstorage to the extension (where they'd then have to be parsed and displayed)

Then, when the event actually goes out in a network request, we can match its event ID and then mark the event as resolved by changing its styling to match events that have been sent

(I was actually thinking of taking a shot at implementation if I can budget some hours towards it this week)

Thanks - love the plugin! It's been a life-saver for testing our snowplow setup.

@ScottyMJacobson ScottyMJacobson changed the title Displaying Queued Events? Displaying Queued Events? (feature request) Mar 12, 2019
@jethron
Copy link
Contributor

jethron commented Mar 14, 2019

Good use case! This will be quite a bit more work than #24 but should be pretty doable. Talking to the content pages will probably require more permissions which I'm not too keen on, but a PR is welcome.

You'll also be tied to the data structure used for the queue in localStorage but the JS tracker doesn't move fast enough for that to really be an issue.

Rather than dummy events, you could also just be running snowplow("flushBuffer"); which should force them all at once no matter how many there are. A simpler change would just add a Toolbar button to call that on the content page, if you don't mind clicking a bit more often. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants