Execution of tracker with render VS redirect_to and other types of responses
Startouf opened this issue · 1 comments
I am wondering a couple things concerning this gem.
I seem to have understood that what the gem does is to inject the various tracking codes into the view that's about to be rendered. The readme isn't clear about
-
Whether calling
tracker
in the controller action A1 thatredirect_to
an controller action A2 thatrender
s something will replay the tracker code into the view of A2. Pretty much like Rails'flash
VSflash_now
For example : how do you track user registration ? It would make sense to track a register event in the controller action with a POST, and not in whatever page you are redirected to after. -
Whether there is a support for non HTML responses such as JS responses
For example : suppose I submit some AJAX form and I'm getting a JS response to confirm the event creation. Can I stilltrack
that and it will add a inject the code in the JS response ?
@Startouf thanks for you question.
-
this is the case. we store events in the rack session when available and render them at once as soon as there is an proper page to do so.
-
this will not be possible, we can only inject the codes/events in html responses
i hope that clear a little bit the understanding what is done how ;) if you've more questions we're happy to help.