Skip to content

Instantly share code, notes, and snippets.

@alfhh
Last active November 25, 2016 17:28
Show Gist options
  • Save alfhh/44089cc25ef84cf1f83daa14acb315f9 to your computer and use it in GitHub Desktop.
Save alfhh/44089cc25ef84cf1f83daa14acb315f9 to your computer and use it in GitHub Desktop.
A basic example of Custom HTML Tag. GTM
<script type="text/javascript">
(function() {
var eventsNames = [];
for (var i = dataLayer.length - 1; i >= 0; i--) {
eventsNames.push(dataLayer[i].event);
}
dataLayer.push({
'event': 'query',
'eventsNames': eventsNames,
'value': 'java-code'
});
})();
</script>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment