feat(store-sdk): agnostic store sdk analytics #903
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the purpose of this pull request?
This PR makes the analytics layer of store-sdk agnostic. It now follows the official Google Analytics 4 structure for these events, and includes the default, recommended events by default.
How it works?
Anyone, including non-VTEX developers, can now use store-sdk to implement their analytics layer with the guarantee that it'll be fully integrated with Google Analytics 4.
How to test it?
There's no much to test.
References
I've set a fixed version for the store-sdk dependency on gatsby-theme-store. I did that so we can evolve store-sdk without having to backport everything to gatsby-theme-store, that'll eventually die anyways.