Anonymous User System Implementation on E-commerce


I’m trying to implement an anonymous user system for an e-commerce website. The problem is how do I merge sessionID with the account? Is this the correct way? Please read below:

(1) Anon User visits the website, check if there’s anon session. If false, create a new anon session.
(2) Anon User adds items to cart. Create a pending order with buyerID == anon sessionID and flag this order as anon order
(3) Anon User proceeds to checkout. If not logged-in, redirect to /login or /sign-up if no account.
(4) After logged-in, redirect to /checkout/review, use anon sessionID to find the order. Then update the buyerID with Meteor userId. Set anon order equal to false.

So, is this a good way?

Thanks in advance!


Usually you dont force user to login, but link anon purchase to provided email.


This package might help.