juriansluiman / SlmGoogleAnalytics

A ZF2 module to track pages, events and ecommerce transactions with Google Analytics
Other
40 stars 20 forks source link

This remembers events and transactions until displayed on a page #11

Closed Marlinc closed 11 years ago

juriansluiman commented 11 years ago

On one hand, I understand the use case. It can be quite tedious to store all details if you have many places where you perform PRG like patterns. On the other hand, I am not sure this must be addressed in this module. There are all kind of edge cases you might want to perform, but are not inherently correlated to Google Analytics logging.

Let me think about this. Also, you now do not type hint on the storage nor tests are provided to validate the behaviour. If we continue on this, please be aware these issues must be solved prior to merging.

juriansluiman commented 11 years ago

To get back at this, I don't think persistency should be incorporated into Google Analytics. It makes the module harder, more complicated and only handles a very specific use case which can be handled otherwise. I would suggest to put the GA object into the session (it should be completely serializable) and pull from it again after the redirect.

Or (as I usually do) use GA only on 20x responses and leave any GA logging outside the scope of 30x responses.