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

Make data structures tracker-agnostic #20

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

Make data structures tracker-agnostic #20

aldesantis opened this issue Mar 4, 2021 · 0 comments

Comments

@aldesantis
Copy link
Member

aldesantis commented Mar 4, 2021

The biggest problem with this extension's architecture, in its current state, is that the format of the Event class, as well as the names of the events and the property names in the serializers, are all specific to Klaviyo, because it was originally extracted from the source code of solidus_klaviyo.

However, the entire idea behind the extension is that it can be used with multiple trackers, not just Klaviyo.

There are two potential solutions here:

  1. Simply provide the hooks for trackers to subscribe to and fire their own events. In this scenario, each tracker provides its own event and serializer classes. While this allows maximum flexibility, it also means that there's very little reusable logic across the different trackers. If we add support for an event in solidus_tracking, each tracker will have to implement it on its own. The same goes for serializer properties. It kind of defeats the purpose of having the extension in the first place.
  2. Make the serializer and event classes more tracker-agnostic by returning more idiomatic Ruby hashes, and allow each tracker to transform the data according to the format for that tracking service. While a bit more complicated to pull off, this feels like the right path.
@aldesantis aldesantis changed the title Make event names and serializers plugin-agnostic Make data structures plugin-agnostic Mar 4, 2021
@aldesantis aldesantis changed the title Make data structures plugin-agnostic Make data structures tracker-agnostic Mar 4, 2021
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