Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

Stepper: Add `ref` field on step track events within the same flow #93060

Open gabrielcaires opened 1 month ago

gabrielcaires commented 1 month ago

Goal

We need to determine the source of traffic for signups and non-signup events, tracking ref=for all subsequent event calls once it is defined.

List of events

Out of Scope

Tech details

We can update the useFlowNavigation hook to return a custom navigate function that always maintains the ref attribute if it is available.

https://github.com/Automattic/wp-calypso/blob/c5ca5f3b5db08a40acc915faf2f4237fc619350c/client/landing/stepper/declarative-flow/internals/hooks/use-flow-navigation/index.tsx#L36

Related

No response

daledupreez commented 1 month ago

I am not sure if this is the right way to solve this, @gabrielcaires. I think it's best to have the ref tracking when we start a flow, rather than on every step. For me, the main concern is that the ref parameter has a clearer meaning when starting a flow -- it means we were referred to this flow from the identified referrer. Once the ref is present on every step event within a flow, the meaning is less clear to me, as the referrer for most of the steps will be previous step in the flow, and not the location specified by the ref parameter.

gabrielcaires commented 1 month ago

I can see your point. It may be redundant info. I will close this issue. if we see a better value we can reopen it.

I create another issue to track the ref on non-signup events.

https://github.com/Automattic/wp-calypso/issues/93061