We’ve discussed why you might want to delay sending product impression data to Google Analytics via event triggering, so that your product impressions are actually reflective of products appearing onscreen. However, that means you are adding event hits to your GA total hits, so ideally you will only send impressions as events when you truly need to. If you’re sending a product detail impression or a promotion impression for a banner at the top of the page, it makes more sense to send the EEc data as payload on the pageview tag (yes, tag – I’m assuming you’re using Google Tag Manager).
The preferred way to give the details to GTM is in the datalayer, but that requires all the EEc information be present in the page in the appropriate syntax upon page load, and sometimes that’s just not practical. However, you can provide the data in a variable instead – see Google Support’s basic Ecommerce Tracking article for as much as Google has to tell you on the matter; the full developer documentation doesn’t say any more.
Basically, you enable Enhanced Ecommerce features but do not check “Use Data Layer.” Instead you can create a GTM custom JavaScript variable that the tag will read from as though it is the datalayer (so a small caveat: this is incompatible with using the datalayer in the same tag, but other tags firing on the page can use the datalayer even if the pageview tag is reading a variable). That variable has to return the object you would otherwise push into the datalayer.
The key to this working, of course, is that even though the tag will fire at page load, you can scrape the page’s contents to construct your datalayer object just the same as if you were pushing to the datalayer to trigger an event (as we did when adding campaign tracking data recently).
Plan B image by sciencefreak on Pixabay.