Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate which events are customer-originated #23

Open
aldesantis opened this issue Mar 4, 2021 · 0 comments
Open

Indicate which events are customer-originated #23

aldesantis opened this issue Mar 4, 2021 · 0 comments

Comments

@aldesantis
Copy link
Member

This extension tracks events at the lowest possible level, i.e. in model methods and state machine transitions.

This is good because it means that the event tracking won't be affected by user-facing customizations, but it may also cause some events to be tracked that are not of interest. For example, if an admin places an order from the backend, we may not want to track an "Order Completed" event, which is the current behavior.

Since we don't know whether these events should be tracked or not and we want to give users as much flexibility as possible, we should find an elegant way to clearly indicate whether an event originated from the customer or not. An example could be a global flag that indicates whether we're part of a request that was customer-initiated:

before_action :set_customer_originated

def set_customer_originated
  SolidusTracking.customer_originated = true
end

(This could also just be part of the global context, see #22.)

The user could then decide whether they want to enable/disable tracking of these events, either in a global configuration flag or on a per-event/per-plugin basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant