Streaming live at 10am (PST)

Global Click Handler Not Working


#1

Hey guys,

I am having trouble getting event tracking to actually work on a recent site. I implemented the code given in the instructions for GA & Mixpanel and I am receiving data in my GA account (also checked in Tag Assistant and that is working) but I am not receiving any event data whatsoever. Any ideas?

The site is http://www.cafenataliecatering.com


#2

Where did you get the code from? The instructions are unclear and the code is horrible. Look, I even fixed it before and you could have just used the forum search function first: https://forum.webflow.com/t/google-analytics-event-tracking-click-tracking/26852?u=samliew

Try changing it to this

<script>
Webflow.push(function() {
  $(document).on('click', '[data-gatrack]', function() {
    var trackData = $(this).attr('data-gatrack');
    if (!trackData) { return; }
    var trackParams = ['_trackEvent'].concat(trackData.split(','));
    _gaq.push(trackParams);
    console.log(trackData, trackParams); // You can remove this line when your issue is resolved.
  });
});
</script>

#3

No need to be so condescending with your reply. Your solution was actually the first one that I tried before trying the code from Webflow's official post, I tried yours again to no avail.


#4

It is now working to the point that I see the event tags firing in Google Tag Assistant and there are events showing in real time but nothing historically. Any suggestions?


#5

Wait a week and check the history again to see if the previous week’s data is captured.


#6

Yeah I saw that it can take a bit so i’ve given it 10 days and still nothing. Maybe it’s an issue on the GA side?