Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Chris Beardsley
Added: Jan 24, 2019 1:36 PM
Views: 46
Tags: no tags
  1. var dlCheck = dataLayer.length;
  2. var ecommArray = [];
  3. for(var i=0; i < dlCheck; i++){
  4. ecommArray.push(dataLayer[i].ecommerce);
  5. }
  6. console.log(ecomArray = ecommArray.filter( Boolean ));