I need a way to track clicks using Google Analytics. I am not able to use a custom attribute using onClick (I get an error - see below):
There was another forum post that mentioned giving the clickable element a unique ID and then “hooking” it up to some custom JavaScript in the dashboard. Here’s the example that was given:
<script>
$(document).ready(function() {
$('#consultation-button-home').on('click', function(e) {
_gaq.push(['_trackEvent', 'Lightbox', 'Open', 'Microsoft Project']);
});
});
</script>
The problem is that this is using “push” and the universal analytics does not use “push”. An example would be:
onclick="ga('send', 'event', 'Splash Right Fixed', 'Click', 'Inquire');">
If anyone knows how to set this up correctly, please let me know. Thanks.
Here is my public share link: http://jal2.webflow.io/
(how to access public share link)