yireo/Yireo_GoogleTagManager2

select_item event is missing the 'index' column

Closed this issue · 1 comments

Hi,

On the listerpages there is an event that triggers a 'select_item' event when you click on a product. So far so good. This event is missing the 'index' column. Currently code wise this makes sense because a details.phtml is re-used in the lister pages.

A index is just a position of the product in the current listerpage so list.phtml is the only place that contains this info.

Adding this information the existing 'afterGetProductDetailsHtml' in not gonna work i guess.

Maybe an extra js that adds a index to the current 'YIREO_GOOGLETAGMANAGER2_PRODUCT_DATA_ID_' blob?

It is a difficult one. However, if we assume that the index has not related to the position attribute of a product, we could say that this index simply needs to start at 1 and then be incremented. I've added a simple fix to allow specifically for this: 1912370