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

6641 send beacon #6820

Closed
wants to merge 8 commits into from
Closed

Conversation

fredli74
Copy link

@fredli74 fredli74 commented Dec 6, 2014

Implemented navigator.sendBeacon as alternative tracking method. (#6641)
I choose to disabled beacon support by default as sendBeacon requests are POST requests (cross
domain awareness). It is easily enabled with _paq.push(["enableBeacon”]);.

It uses the same format as bulk requests to avoid posting parameters as forms (resulting in a lot of overhead data).

fredli74 and others added 5 commits December 3, 2014 14:27
This reverts commit 1698805.
changes to fix broken getImage callback due to server responding 204
Implemented navigator.sendBeacon as alternative tracking method.
Disabled by default as sendBeacon requests are POST requests (cross
domain awareness). Enable with `_paq.push(["enableBeacon”]);`.
@@ -2421,8 +2423,7 @@ if (typeof Piwik !== 'object') {
function getImage(request, callback) {
var image = new Image(1, 1);

image.onload = function () {
iterator = 0; // To avoid JSLint warning of empty block
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this line causes a JSLint warning

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, thank you. I did not notice any JSLint warning on that so I removed it. Maybe I ran it with wrong options. I'll put the line back in.

@mattab
Copy link
Member

mattab commented Dec 10, 2014

Thanks for the PR @fredli74
it would be nice to add automated tests for this feature to check in the future that it will always work. you can find the existing tests in: https://github.com/piwik/piwik/blob/master/tests/javascript/index.php#L405

the tests will be executed after each of your commits visible on travis CI in the JavaScriptTest build

@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Dec 10, 2014
@mattab mattab added this to the Short term milestone Dec 10, 2014
@mattab mattab added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Dec 10, 2014
To avoid JSLint warning of empty block
Changed navigator to navigatorAlias
Renamed uuid argument that sets visitorUUID in Tracker constructor to avoid collision inside getRequest
@mattab mattab modified the milestones: Short term, Mid term Dec 18, 2014
@mattab
Copy link
Member

mattab commented Apr 7, 2015

Maybe someone from the team would be interested to take a look at @fredli74 PR and maybe add tests or a review?

@mattab
Copy link
Member

mattab commented Jul 25, 2016

Thank you for this proposed pull request.

Because it was last updated more than one month ago, it is our policy to close pull requests opened for a long time without updates. If you would like to continue work on the pull request, please simply ping us to have it re-opened (after you have pushed a new commit).

We hope you understand this and we look forward to seeing an update from you on this pull request or another one!

Thanks.

@mattab mattab closed this Jul 25, 2016
@mattab
Copy link
Member

mattab commented Mar 4, 2018

FYI we are implementing support for sendBeacon in #12538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants