optimizely/javascript-sdk

sendBeacon support for tracking events?

joshunger opened this issue ยท 22 comments

๐Ÿ‘‹ Is there support for sendBeacon to send tracking events?

Reference: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon

We are missing events sometimes when we navigate quickly after calling track. We switched out Amplitude calls to sendBeacon which fixed the issue on our analytics side and we'd like to do the same thing with Optimizely.

We also have the same issues. Could you please please give feedback here?

Other Companys like Google use sendBeacon already for event tracking. It's exactly meant for your use case.

It's intended to be used for sending analytics data to a web server, and avoids some of the problems with legacy techniques for sending analytics, such as the use of [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest).

Woah. Sorry for the delay in acknowledging. Let me discuss this during today's Standup/Planning and get some initial thoughts, especially from the primary devs and product owners.

The primary devs think this is definitely something to run a spike to research the efficiency, reliability, and how to implement sendBeaon into the browser context.

The product team thinks this can fit into a QY1 or QY2 initiative.

A Jira item is being created to prioritize.

Thanks for the feedback. We are looking forward for it. Unit you release the feature we will implement a workaround on our side using sendBeaon to call our server and send the metrics from it.

Do you inform us here in the ticket about the progress of the sendBeaon implementation?

Best regards
Matthias

I'll put a note in the Jira item to update this Issue upon milestone progress.

@mikechu-optimizely how is the progress? I filed ticket on this matter https://feedback.optimizely.com/ideas/ODPI-I-22

@iamstarkov, Sorry for the delay in replying. I'll link up the feedback item to the internal engineering Jira ticket (FSSDK-8752) for this.

@russell-loube-optimizely This ticket is ready for pointing. Can you run this through your Product prioritization and see where it fits?

@mikechu-optimizely , thanks for the tag. Yes, let's discuss this as a team which has been long overdue.

We'll provide any updates here.

We are going to move forward with updating the SDK to leverage sendBeacon for sending track & Advanced Audience Targeting (AAT; ODP) events.

@russell-loube-optimizely will have the Product team take this GH Issue and Aha (feedback item) and add it to their prioritization. From there, we can give an ETA.

@mikechu-optimizely Apologies for the prod, but we've been finding the same issue as above. Is there a fresh update that I can bring back to my team?

Cheers!

No troubles for the poke ๐Ÿ‘ˆ ๐Ÿ˜

I still see the Jira ticket (FSSDK-8752) in the "ready for story pointing" hopper. It's been approved and just needs to be pulled into a sprint plan after assigning the points and a dev resource to do the work.

I'll add another note to the ticket, ping @russell-loube-optimizely and the product team, and also mention it at our next stand-up. ...see if we can push the gas pedal a little more. I've put on my calendar to update this thread 24 July in the afternoon.

The ticket has been moved into this sprint as a spike first.

We're looking into fetch's keepalive as a solution for both browser and node contexts allowing us to implement more quickly. Using fetch() appears to be a good candidate to replace sendBeacon().

@raju-opti

Firefox doesn't support keep alive, so we'll be evaluating implementation with sendBeacon where needed.

Yikes. Our research was completed back on the 4th of this month.

I've requested that a development ticket to be created off the Spike and prioritized into a coming sprint. Our product team will be setting when to pull the work into a near-term sprint.

Product has created ticket FSSDK-9605 which is set for async pointing.

Async story points applied. We have a planning meeting today. I'll push to get this added to our next sprint.

cc @russell-loube-optimizely

Ticket FSSDK-9605 is in the active sprint.

This #866 is out there under review now. We'll have it merged in the next few days.

We'd love any feedback you all have @joshunger @ruettenm @iamstarkov @adamhouten

PR #866 passed code review and implementation testing.

@raju-opti & I are hammering an e2e automation test that's not happy....

Looking for last ๐Ÿ‘ from senior architect, then we'll merge #866

Good comments from @alexparish

PR #866 has been merged.