Created
March 12, 2015 11:08
-
-
Save osecluna/4219da239f70901a0d29 to your computer and use it in GitHub Desktop.
filter impressions from datalayter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dataLayer = dataLayer.filter (function (el) { | |
/* Clean up datalayer so there are not multiple impressions objects */ | |
if (el.ecommerce) { | |
return !el.ecommerce.impressions; | |
} else { | |
return el; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You don't need the
else
: