Splitting up large requests due to payload size issues

Viewed 871

I've just found out that gtag limits hit payloads to 8k. If your request is larger it get rejected with a 413 error.

In my case it's sending the GA4 view_item_list event with about 50 products.

Is it possible to split up the data into multiple payloads, and still have it register as one list view?

In GA4 it's made a little worse as it bundles multiple events into the one payload, even if it would make the payload too large. Thus other small events are also lost.

Using product data uploads would not be a great option as our solution will be used on many sites where it would be hard to get them to manage those product lists.

Sending events on only visible products may work, but it would then greatly inflate the list view counts.

1 Answers

You can send products to different events by keeping the numbering of their position. This is what is normally done with impressions also in Enhanced Ecommerce in Universal Analytics, so that the information on the products actually viewed by the user is sent when they enter the user's view port. So for example, in the first event the first 4 products of list 'A' will have positions 1, 2, 3 and 4. The second group of products displayed will be sent in another event always with list 'A' and position 5, 6, 7 and 8 and so on.

Note: sending all the products of a list together in one shot, for the reason mentioned above, makes you lose the meaning of impressions, since on opening the page the product in position 80 will be seen for Analytics as the product in position 1, but most likely the one in position 80 will almost never be seen (so it should not be sent until it has actually been displayed).

Related