VIA Chris in Slack
I’m trying to register ‘login’ and ‘sign_up’ in as a custom analytics event since they’re not among the standard events. I made a workaround that reads the current page and the previous page and compares login status on both, then would fire the appropriate custom event. However, the new account pages don’t fire the custom pixels.
Does anyone have a workaround for this?
you really have to work at it but it’s possible:
- create a flow that adds a tag (i also added as meta field for API use)
- add liquid code to process it to a customer web-event in liquid
- use custom web-event in web-pixel
analytics.subscribe("gtm_extras", (event) => { event.customData.customer_create_date }
note: only on front-end of site, but most customers will come back there or use on future visits
note: this wont be available though checkout - if you want that you’ll have to store in the session as well
Hello! It is planned to have Web Pixels on new customer accounts at some point, but it’s not yet available.
In the meantime, if you’re looking to manually track signups and logins, it’s possible to check if the init.data.customer
object is available. If it is, the customer is logged in.
If it isn’t, local or session storage can be used to keep track of this state across page navigations, and then, if init.data.customer
ever gets populated during the session, it means the customer logged in or signed up.
Unfortunately, the creation date is not available, so no obvious way to tell if it’s a signup or a login. However, it’ll work on checkout as well.
@emileber the date of first-opt-in is what’s important as well as current status - so this only gets you half-way there.
What I’m suggesting is a fully integrated Web Pixels solution, no liquid or custom event required, but you’re right that it can’t distinguish signups from logins.