Skip to content
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

Can you use data from the app inside the middleware? #6

Open
jhilden opened this issue Dec 16, 2011 · 1 comment
Open

Can you use data from the app inside the middleware? #6

jhilden opened this issue Dec 16, 2011 · 1 comment

Comments

@jhilden
Copy link

jhilden commented Dec 16, 2011

For example for Google Analytics e-commerce tracking, you would need to provide the price of the current transaction value to the tracking pixel. Is it possible to access that information from inside the middleware?

@mikebaldry
Copy link
Owner

Hi, I had not taken this kind of thing in to consideration - It's quite a specific case. As it's a middleware it doesn't have any proper interaction with the application, other than receiving the response.

Maybe it would be possible to place some kind of marker in the page response and parse this out before rendering - It seems kind of dirty to me.

I'm not sure of the exact life cycle of a middleware, is it initialized per request? Maybe the page could call instance methods on the current request instance to set properties, which the pixel rendering could use?

Can anyone else think of a better way?

I currently don't have the time to add this feature, but feel free to discuss and fork :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants