๐คท What does it do?
The macro needs an array of object as input. My suggestion is that you get array as a datalayer variable in your website. It picks the assigned variable (in this case ‘id’) and outputs it again like an array: [ ‘123’, ‘456’ ].
๐งโ๐ป Usecase
This is used commonly for ecommerce websites. The information about multiple products is pushed as an array into the datalayer. You want to filter it to send to ViewContent or Purchase tags for example. This macro helps you.
๐ Instructions
- Replace the {{var_products_array}} by a GTM variable, which contains an array of information.
- Replace ‘id’ in line 6 with the variable name, which is inside the array.
Isn’t this the macro you were looking for? Check-out all the macro’s which I’ve shared on my site. or request one.