Created
March 13, 2020 13:06
-
-
Save waseemnawaz/a18b7ab5ca767f17ad2a0dd53bc8a18d to your computer and use it in GitHub Desktop.
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
<script> | |
(function(){ | |
var theaccordions = document.querySelectorAll('.card-header'); | |
var clickit = function(event){ | |
window.dataLayer.push({ | |
event: "accordion", | |
eventType: event.target.innerHTML | |
}); | |
} | |
for(var i = 0; i < theaccordions.length; i++){ | |
theaccordions[i].addEventListener('click', clickit, true) | |
} | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment