Streaming live at 10am (PST)

Google Analytics event tracking (Click Tracking)


#1

Continuing the discussion from How to track Webflow Form with Facebook (Pixel) and Google Analytics:

Hi All,

I have read every article on webflow regarding the GA tracking integretion.

Since I'm planning to set up multiple parameters per page I would prefer to create a global click handle. I followed the step by step guide and on here but nothing seems to work. It's simply not showing up in GA.

I'm using following header code:

<script> $(document).ready(function() { $(document).on('click', '[data-gatrack]', function(e) { var $link = $(this); var trackData = $link.data('gatrack'); if (!trackData) { return; } var trackParams = ['_trackEvent'].concat(trackData.split(',')); _gaq.push(trackParams); }); }); </script>

PLUS the following custom parameters:
Name: data-gatrack
Value: button,explore-topics

Would honestly appreciate any help on this.

Thanks,


Global Click Handler Not Working
#2

Should be like this:

<script>
var Webflow = Webflow || [];
Webflow.push(function() {
  $(document).on('click', '[data-gatrack]', function(e) {
    var trackData = $(this).attr('data-gatrack');
    if (!trackData) { return; }
    var trackParams = ['_trackEvent'].concat(trackData.split(','));
    _gaq.push(trackParams);
  });
});
</script>

Paste it in Site Dashboard > Custom Code > Footer Code textarea.

If you still have problems, paste published url here.


#3

This topic was automatically closed after 60 days. New replies are no longer allowed.