-
Notifications
You must be signed in to change notification settings - Fork 85
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
Custom PageViewExit event #153
Comments
Hi @CyranMS But if you want to just fix the issue - look here to see what exactly happens with our implementation of So in your case, something like the code below, should work componentWillUnmount() {
client.recordEvent({
'collection': 'slide_views',
'previous_slide' : this.state.current_slide,
'current_slide' : -1,
'previous_slide_total_page_time' : slide_timer.value(),
'requestType': 'beaconAPI'
})
} Note: client variable has to be defined. |
Thanks @adamkasprowicz |
I Had a quick look into it and its seems the only way to make it reliably work is to use heartbeats to a server, after reading some stackoverflow also this was suggested. In cases where the browser crashes / is closed we will never get an event with the beforeunload method. Maybe there is a way to use keen.io on the server side so that we fire the browser close event from the server when the users heartbeat dies. |
Another idea would be if we can assign a random id for each opened content and then overwrite the last slide value every X seconds of that tracking event. In the keen.io docs i could not find anything yet. |
Hi guys,
by now I'm frustrated because I cannot get it to work:
the basic keen pageviewonexit works like a charm. But I need aditional information on one specific page in my react single app.
Any ideas what I'm doing wrong? Is there an easier way to have custom tracking events with keen-tracking.js?
The text was updated successfully, but these errors were encountered: