I have the following array in my datalayer :
'pageCategory': ['Category1','Category2','Category3']
I would like to pass each one of these category within google analytics with a custom dimension. Following some answers I found on a Google Forum I create the following HTML tag in my GTM :
<script>
var categories = {{sub_Categories}};
for (var i=0; i<categories.length; i++) {
dataLayer.push({
event: 'categoryProcessed',
category: categories[i]
});
}
</script>
In Preview debug mode, I can see that the tag is firing an event for each category and pushing for each event the value of each category in a different datalayer.
Then I kind of stuck, I don't realy know what should I go next. Do I need to fire my GA analytics TAG for each event ?