5

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.

2
  • How did you find out that gtag limits hit 8k? I was struggling wondering why I could only fit 20 items in my ecommerce.items array.
    – ali
    Commented Apr 20, 2021 at 5:42
  • The 8k came from gtag documentation. Since then I did some testing and found that the limit is 16k if the payload is sent via a beacon. Commented Apr 21, 2021 at 20:30

1 Answer 1

4

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).

8
  • Great point with the positions. I'll try and also implement some detection of products coming into view to make it more realistic. Commented Mar 11, 2021 at 22:30
  • I just checked the GA4 specs for view_item_list and don't see an option for position? developers.google.com/gtagjs/reference/… Commented Mar 12, 2021 at 4:36
  • Have you not considered the index parameter? It is in the documentation. Commented Mar 12, 2021 at 5:15
  • LOL, didn't spot that Commented Mar 13, 2021 at 1:06
  • Unfortunately GA4 tends to bundle the events and still ends up sending them all at once and exceeding the payload limit. Commented Apr 21, 2021 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.