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

Send productImpressions in batch instead of sending for each product #147

Open
klzns opened this issue Jun 26, 2019 · 0 comments
Open

Send productImpressions in batch instead of sending for each product #147

klzns opened this issue Jun 26, 2019 · 0 comments

Comments

@klzns
Copy link
Contributor

klzns commented Jun 26, 2019

Today productImpression is being sent separately for each product on the shelf. For each product we trigger a hit to GA and eventually that can exceed a limit stablished in the contract. To save hits we should send them in batches so we hit GA fewer times.

We should beware that there's a limit of 8kb for a hit, that can happen if we send more than 50 products in a hit, for example. One solution for that is to send only productImpressions of products visible in the screen.

Possible Solution

We might use context in the Shelf component to listen to events triggered by each product and then trigger the event after some miliseconds.

We could also use intersectionobserver to trigger only events to products visible on the screen.

Steps to Reproduce (for bugs)

Open a store with a shelf and see that productImpression is sent N times.

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