algolia / search-insights-gtm

Google Tag Manager template for detecting front-end Algolia search metrics
Apache License 2.0
6 stars 5 forks source link

feat: chunk events with items exceeding limits #13

Closed eunjae-lee closed 2 years ago

eunjae-lee commented 2 years ago

Before this PR, it used to slice objectIDs or filters to fit in the API limitation, which results to missing values in the request.

In this PR, it chunks the payload into multiple if it exceeds the limit. This is possible now due to the addition of the new sendEvents method in search-insights. However, it's not released on search-insights side yet. So we need to wait for it first.

Another context: There was no mention about filter events in the GTM documentation. Now that we're about to add it, the limit of 10 for filters will likely cause issues if customers have many filters on their website (especially with filter view event.)