Last active
April 15, 2019 07:29
-
-
Save maltehelmhold/004ae38ff5881f641e5ed72183624557 to your computer and use it in GitHub Desktop.
Datalayer Push für GTM Kurs
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
# so pusht du ein event bei Button Klick | |
<a href="#" name="button1" onclick="dataLayer.push({'event': 'button1-click'});" >Button 1</a> | |
# so pusht du ein event + statische daten + dynamische Daten mit onclick: | |
<a href="#" name="button1" onclick="dataLayer.push({'event': 'button1-click', 'farbe': 'rot', | |
'inneresHTMLdesButtons': this.innerHTML });" >Text des Buttons ist das innere HTML</a> | |
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> | |
dataLayer.push({ | |
'event': 'maltesButton', | |
'maltesButtonText': document.getElementById('maltesButton').innerHTML | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment