segment-boneyard / analytics-magento

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

Number of purchases #24

Closed ianstormtaylor closed 10 years ago

ianstormtaylor commented 10 years ago

From a beta tester email:

It would be very useful to have attributes such as number of purchases, amount, and SKU per user (eg to transmit Intercom).

Some of those sound weird or hard, but @astorm what do you think? Number of purchases sounds like a really useful one if Magento exposes that. Total spent could also be interesting. Not sure what the SKUs would be about

astorm commented 10 years ago

Which events are we adding these to?

ianstormtaylor commented 10 years ago

I think what he was looking for was to identify a user with those traits, instead of related to an event.

astorm commented 10 years ago

Ian, "you think what he was looking for" — I'm not clear from that. Are you saying you want these in identify if possible? Or something else?

I work for you, and for Segment, not the beta testers. I need you to synthesize their feedback into how you want your extension to work -- having me guess at what you want based on the customer feedback will just lead to burned cycles and madness. Thanks.

ianstormtaylor commented 10 years ago

K sorry about that, here it is again:

Is it possible to know the number of purchases a given user has made? If so that would be good to record as a trait on identify. Same goes for total revenue a customer has "purchased". Let me know and I can come up with the right trait name to use.

I'll try to be more clear about when I'm looking for Magento expertise and best-practices vs. when we have a hard requirement.

astorm commented 10 years ago

Magento doesn't expose that information directly — there are aggregate reports, but not all systems have these reports setup. The two bits of information you're after though are relativly easy to query for directly in the database (if you know what you're doing). I've added a total_orders and total_purchased to the identity call. You can see them below as 1 and 30.0000 below (new user, only one order)

aggregate columns