Comments (6)
As far as I can tell, the JSON serializer in rails 4.1+ simply cannot be used for serializing objects but only for primitves such as hashes, arrays, strings, etc.
So I guess the only possible solution would be to store the events using a hash representation in the session and then reinitialize the original event objects from those hashes.
from rack-tracker.
Fix was merged into master.
from rack-tracker.
This issue has been resolved by PR #16 but when this change is deployed there can be exceptions with old session data that still contains serialized objects instead of the new hashes.
NoMethodError: undefined method `except' for #<Rack::Tracker::GoogleAnalytics::Send category=...>
/ruby/2.1.0/bundler/gems/rack-tracker-2f0c5b612141/lib/rack/tracker/handler.rb:16 in "block in events"
How should we react to that? Just put a warning in the changelog? Build some migration code?
from rack-tracker.
This only happens if a users last request before the deployment was a redirect that stored the rack-tracker event in the session (as a serialized object) and the next request is after the deployment and excepts a serialized hash. All further requests are not affected. In our case it produced 2 exceptions after the deployment.
from rack-tracker.
¯_(ツ)_/¯
maybe advise users to change the session secret, so everything is invalidated
from rack-tracker.
wouldn't that be pretty drastic to invalidate thousands of sessions just to prevent 2 exceptions?
from rack-tracker.
Related Issues (20)
- No such handler: Facebook pixel (ArgumentError) HOT 3
- How to use outside of controller? HOT 5
- Google Analytics using the beacon transport HOT 1
- Syntax when using rack-tracker for both Google Analytics and Google Ads HOT 4
- Bing tracking HOT 1
- Sending rack-tracker events from "backend" code HOT 3
- Render templates directly for JS responses HOT 3
- Google Tag Manager with turbolinks: true duplicates pageView when using Push HOT 6
- No events being injected into the page HOT 1
- Google Global integration: purchase transaction_id HOT 7
- content security policy HOT 10
- how to set user_id? HOT 1
- Avoid injection for AMP pages HOT 9
- How can I use the tracker in a model or service? HOT 3
- Remote form and AJAX request redirects never run events HOT 2
- syntax error, unexpected ':', expecting keyword_end (SyntaxError) HOT 6
- Can not get FacebookPixel to work HOT 1
- Add Support for Reddit Ads Pixel HOT 3
- Update is coming ? Google Analytics 4 GA4 Killed my groove HOT 11
- Can't Override Default google_tag_manager Event
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rack-tracker.