We have a page in our mini where we fetch products (using the “useProductSearch“) based on the user’s input and we have a “Buy Now” button so the user can directly proceed to buy the product from the mini, we want to track the event when the user clicks on the “Buy Now“ button and whether or not he/she goes through with the checkout. This is important for us as we want to track the purchases made by the user based on the recommendations we provide. Please suggest a robust way to do achieve this.
Buy Now button can’t be implemented directly. We strongly recommend (and soon we will enforce it) to open the Product Detail page, and from there the users will be able to buy the product. You can use the navigateToProduct hook: useShopNavigation
To check how many sales your mini did, you can always check the Sales analytics report: Analytics
So basically what you are saying is that if we navigate to the Product page using the useShopNavigation hook (navigateToProduct), then the mini takes care of tracking the purchase? But what happens once the user completes the checkout? Is he redirected to the mini? Because we also want to track some specific details like for which event did the user make that purchase.
For example there are 2 events:
Mom’s birthday and Wife’s birthday maybe the two events and they might have some common products based on the user’s input, so if a purchase is made by the user, then we want to track the user’s email/user id (supabase generated id for the user table), event’s ID (supabase generated id in events table), the product id, product price etc.
Hey @Quique-Shopify I understand your concern about user’s privacy, so then what would be a solution for this? As we need to track whether the user made a purchase from a specific event’s page or not, so that we can associate that purchase to that specific event.
We are building a mini that tracks events added by the user like birthdays, anniversary, christmas etc. Each event is associated with a recipient and some other details about the choice of products/brands for the recipient and the budget of the user (for that specific event). Based on these details an event is saved for the user in a supabase table and some products are recommended to the user based on the budget, profile notes (choice of product, brands etc). If the user saves a new event, goes to the event details page, sees a product and purchases it, then we need to associate that purchase to that specific event.
This enables us to mark that event as “Done” (as in gift purchased for this event by the user). And add the purchased product’s price to the yearly spent (by the user) to track his overall purchases spent on all gifts for all family/friends for the current year.
Any suggestions or some sort of workaround are welcome.
Hey @Quique-Shopify I am using the ProductCard component and I think it already internally uses the useShopNavigation hook (navigateToProduct) to redirect to the Product Details page correct? So no need to manually use the onProductClick function and add the navigateToProduct specifically right?