Background: I've enabled enhanced ecommerce tracking on my website, which is implemented via Google Tag Manager
I've encountered an issue where pageviews are not being tracked for some pages with many product listings. The issue is the amount of product impressions that are getting pushed to the dataLayer - exceeding the payload size limit and preventing the pageviews from being sent. While researching I've found basically two suggestions:
Create a product data import for product attributes that are matched to the product ID that gets pushed.
Most suggestions point to this article, which explains how to break the impressions data up and send it in multiple hits.
With enhanced ecommerce, my understanding is that only the most recent 'ecommerce' variable push to the dataLayer is processed. Also any push will overwrite the previous event variable value. My question is - how can I break impressions into separate dataLayer pushes? Won't one batch of impressions override the previous, resulting in only some of the impressions getting pushed and tracked?
TL/DR: If I set up impression hits to get around payload size restrictions like the example below, won't the second batch overwrite the first?
dataLayer.push({
'ecommerce' : {
'impressions' : batch 1
}
});
dataLayer.push({
'ecommerce' : {
'impressions' : batch 2
}
});