segment-boneyard / analytics-magento

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

Aliasing on signup only #26

Closed ianstormtaylor closed 10 years ago

ianstormtaylor commented 10 years ago

I can't verify this completely, but looking at a quick stream of the data coming in from one of the beta testers, it seems like alias is called next to every identify, when a customer logs in. But we actually need the alias to only ever be called once per customer, right after they signup and are given an ID in Magento for the first time.

Feel free to close if I got this wrong from the stream

astorm commented 10 years ago

That's correct, the way I implemented this was an alias for each login. I didn't realize it was only meant to be called once.

I've added an attribute to the customer object to track if an alias has been sent yet, and used this to implement one alias per user ever. Future logins after the first login (first with this update) will skip the alias call.

ianstormtaylor commented 10 years ago

Would it make sense instead of having the extra attribute, to just put the alias call in the Registered event code path? Instead of the Logged In event path?

astorm commented 10 years ago

Quick first thought, yes, that seems like a good idea, but what happens when a customer is created in the backend account panel, programmatically via the API, or other means that don't involve a web browser?

ianstormtaylor commented 10 years ago

Good question, didn't realize those cases, but luckily I think that's actually alright for us, because we only really need the alias call when we want to carry over the anonymous state that was in the cookie. So when we have those other cases, we actually don't even need alias at all which is a relief. Does that make sense?

On Thu, Jul 17, 2014 at 9:33 AM, astorm notifications@github.com wrote:

Quick first thought, yes, that seems like a good idea, but what happens when a customer is created in the backend account panel, programmatically via the API, or other means that don't involve a web browser?

— Reply to this email directly or view it on GitHub https://github.com/segmentio/analytics-magento/issues/26#issuecomment-49331230 .

astorm commented 10 years ago

That makes sense Ian -- but since we can't rely on customers registering with the website, in order to get that first alias call we'll need the property on the customer object.

ianstormtaylor commented 10 years ago

Ah I see, good call

On Fri, Jul 18, 2014 at 9:49 AM, astorm notifications@github.com wrote:

That makes sense Ian -- but since we can't rely on customers registering with the website, in order to get that first alias call we'll need the property on the customer object.

-

Customer has account registered via non-browser means

Customer comes to site anonymously

Customer logs in

— Reply to this email directly or view it on GitHub https://github.com/segmentio/analytics-magento/issues/26#issuecomment-49453426 .