doorkeeper / event_tracker Goto Github PK
View Code? Open in Web Editor NEWEasy tracking using mixpanel or kissmetrics.
Home Page: https://www.doorkeeper.jp/developer/event-tracker-mixpanel-kissmetrics?locale=en
License: MIT License
Easy tracking using mixpanel or kissmetrics.
Home Page: https://www.doorkeeper.jp/developer/event-tracker-mixpanel-kissmetrics?locale=en
License: MIT License
Since event_tracker injects its HTML into the head tag with an after_filter
, a request that is halted in a before_filter
and rendered means that any other before_filter
and after_filter
methods won't be called.
This introduces the problem where you cannot track metrics on any page that is rendered in a before_filter (that is halted, of course).
There's a todo on the main readme so I figured I'd start some discussion around it since I had a use for it this morning.
The intention being that you should be able to trigger event tracking upon an action triggered from Javascript.
Something like this(jQuery):
$(function(){
$("a").on("click", function(){
track_event("Clicked link");
});
});
Right now the track_event
method puts each event call into the session(session[:event_tracker_queue]) and then appends them to the body tag. How about we have track_event_tag
which just outputs the event tracking code only?
In the view
$(function(){
$("a").on("click", function(){
<%= track_event_tag("Clicked link") %>
});
});
Outputs
$(function(){
$("a").on("click", function(){
mixpanel.track("Clicked link");
_kmq.push(['record', 'Clicked link']);
ga('event_tracker.send', 'event', 'event_tracker', 'Clicked link');
});
});
the thing is that the app we are working on uses 2 layouts for 2 cases, one called application.html.erb, the other one called project.html.erb
in project.html.erb there is no mixpanel javascript in the header, am I doing something wrong or the gem is not built for such cases?
Thank you.
I recently stumbled upon an issue with tracking events. After registration in my website, I accidentally clicked on an advertisement link in the page following the registration. I used the "back" button of my browser to get back to the last page of my website. This triggered the previous "registration event" a second time. Any chance to avoid that behavior somehow?
Google allows to mark some events as non-interaction.
https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#non-interaction
If you send event in Google Analytics but user bounces on the same page it is not tracked as bounce as Google treats that event as user action. Would be great if we could set event as non-interactional.
Will try to make pull-request myself.
I just noticed that turbolinks breaks event_tracker. Only the first page load gets tracked. After that, no more event get to mixpanel or kissmetrics.
PS: I read turbolinks navigation was to become the default in Rails 4.
Hi,
Great gem! I see no alias option, can I add it or am I just missing it?
I got an error with this code:
track_event("Event", job_title: name: @object.virtual_attribute)
Now I must append to_s
to the method:
track_event("Event", job_title: name: @object.virtual_attribute.to_s)
Can the gem perform to_s
(or whatever) before storing data into session?
Intercom has similar support for tracking events and similar "people" support, would a PR be welcome?
Related links:
http://docs.intercom.io/Configuring-Intercom/adding-custom-data
http://docs.intercom.io/intercom-javascript-api
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.