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

Add support for text events #15

Merged
merged 1 commit into from
Sep 1, 2017
Merged

Add support for text events #15

merged 1 commit into from
Sep 1, 2017

Conversation

joehand
Copy link
Collaborator

@joehand joehand commented Aug 31, 2017

Adds support for navigator.sendBeacon sent events. Currently Chrome limits the content types in sendBeacon for security reasons, so we cannot use json. For example, we are looking at this client side library.

We want to track outbound links and the best way to do that is with sendBeacon. But json is not supported right now =(.

If this is merged we'll probably use microanalytics on the client side but I can look into adding this to the fa client too!

Adds support for `navigator.sendBeacon` sent events. Currently Chrome limits the content types in `sendBeacon` for security reasons, so we cannot use json.
@codecov
Copy link

codecov bot commented Aug 31, 2017

Codecov Report

Merging #15 into master will decrease coverage by 2.39%.
The diff coverage is 40%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #15     +/-   ##
========================================
- Coverage   94.49%   92.1%   -2.4%     
========================================
  Files           8       8             
  Lines         109     114      +5     
========================================
+ Hits          103     105      +2     
- Misses          6       9      +3
Impacted Files Coverage Δ
lib/server.js 94.11% <40%> (-5.89%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0545489...e94dc8a. Read the comment docs.

@vesparny
Copy link
Owner

vesparny commented Sep 1, 2017

This looks good to me. Should we add a test?

@vesparny
Copy link
Owner

vesparny commented Sep 1, 2017

Using https://github.com/yoshuawuyts/microanalytics instead of the fair-analytics client would also be a good choice.

Only problem I see is the sendBeacon API is not supported by all browsers, but this should be easily solvable with a polyfill

@vesparny
Copy link
Owner

vesparny commented Sep 1, 2017

Let's merge this one.
I will add tests in a separate PR.

@vesparny vesparny merged commit 3084a28 into vesparny:master Sep 1, 2017
@vesparny
Copy link
Owner

vesparny commented Sep 1, 2017

@joehand I've released v1.2.0 that includes your contribution.

Edit:
please install 1.2.1

@joehand joehand deleted the patch-1 branch September 1, 2017 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants