Hi everyone,
I’ve developed a Shopify app similar to Age Verify that shows an age verification popup to users when they visit a merchant’s store.
I want to track and display the following analytics on my app’s dashboard (analytics page):
-
How many users visited the storefront and completed the age verification process.
-
Out of those, how many were logged-in customers and how many were guest users.
-
These stats should be separated per store, as multiple stores (e.g., Store A and Store B) might install my app.
So for example:
-
Store A: 150 users verified → 80 logged-in, 70 guest
-
Store B: 200 users verified → 50 logged-in, 150 guest
My questions:1. What’s the best way to detect whether the user is logged in or a guest on the storefront from within my app’s script or popup?
-
How can I track this data and associate it with the respective store using Shopify APIs or storefront methods?
-
Are there recommended best practices or endpoints for storing this kind of tracking data for analytics?
Any guidance or examples with code in nodejs would be really helpful. Thanks in advance!