segment-boneyard / analytics-magento

[DEPRECATED] The hassle-free way to integrate analytics into any Magento store.
15 stars 19 forks source link

Deferred Action Can't Handles More than One Item. #21

Closed astorm closed 10 years ago

astorm commented 10 years ago

From email — 

Hey Ian, thanks for the package. Hey Alan.

I've taken a look at the extension and I like it. In particular, I like the approach to AJAX/redirect event buffering as well as the template/layout structure.

However, while the guts are awesome, there are some departures from our current approach, specifically in the business logic/tracking side. So we wouldn't be able to participate in the early beta of this extension at this time.

A couple notable differences for us:

To incorporate it and not disrupt our historical data and existing structure would both take time and end up having to touch the extension code to a point it wouldn't be a very representative beta test. I think our use case is specific, and I don't want to derail this plugin because I think it is awesome, especially for greenfield implementations; as a result, it might be best for us not to get in the way.

One hypothetical way I see that we would be able to participate would be if the tracking core logic (the templates, deferred actions model, and blocks) were split from the business implementation (actual event hooks). In that case, I would be the first one on the list to beta test and possibly contribute to the tracking core. Please don't go out of your way on our behalf, but if something like that does happen or as this extension hits more milestones, I'd love to be kept in the loop.

I'm really interested personally in this level of tracking, so even if we can't be involved immediately, I would appreciate any updates in general too. Let me know if I missed anything or can answer any questions.

(One quick bug report I noticed: it seems Segment_Analytics_Model_Front_Controller#addDeferredAction uses an associative array to buffer the $action_data. This causes multiple actions sharing an $action to buffer incorrectly (if you add two items to cart, the next page load only dispatches an event for the second item). Buffering the $action-$action_data pair as a tuple might fix it).

Thanks,

SX

On Mon, Jul 14, 2014 at 2:24 PM, Ian Taylor ian@segment.io wrote: Hey Steven,

Absolutely. I've attached the code for the beta version of the extension. It actually does handle events that happen on AJAX actions already :) so that could definitely help solve your problems there. I've cc'ed Alan, who is the primary developer, in case you have any questions!

Take a look at the code, and then let us know if you'd like to beta test and we can work with you to solve any issues you come up against.

Cheers, Ian

On Mon, Jul 14, 2014 at 11:20 AM, Steven Xu steven@tatcha.com wrote: Hey Ian, great to hear from you. I'd love to check out the code to review it to see if we are able to beta test.

We couldn't wait to integrate so we built an in-house extension, so I'd have to check it out to see if it's compatible. Fingers crossed it is since we're doing pretty generic stuff; I think I could take a glance and let you know. I'd even be down to cut it over to your extension if it was further along in solving some of our trickier problems like buffering JS events that occur on redirecting or AJAX actions.

SX

On Mon, Jul 14, 2014 at 11:09 AM, Ian Taylor ian@segment.io wrote: Hey Steven!

Ian from Segment here — Jake told me that you might be interested in being one of the beta testers for our new Magento extension, so I wanted to reach out.

Quick overview: we've built a Magento extension that includes all of the ecommerce tracking you would want (orders, add to carts, newsletter signups, reviewing products, etc.) automatically, so that you don't have to touch the code at all yourself. You just drop it in, and voilà, you have a nice ecommerce tracking setup that can be sent to any tool on our platform.

Would be interested in being an early beta tester with us?

Let me know, and hope you had a great weekend, Ian

astorm commented 10 years ago

Added a new deferred action implementation that should allow multiple actions with the same name to be added.