Giter VIP home page Giter VIP logo

event_tracker's Issues

AJAX tracking

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');
  });
});

can't dump hash with default proc

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?

Problem with turbolinks

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.

Events are tracked again when using the back button of the browser

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?

mixpanel js code shows up only in application.html.erb layout

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.

Alias option

Hi,

Great gem! I see no alias option, can I add it or am I just missing it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.