1. Home
  2. ReHub Theme
  3. Affiliate settings
  4. How to add statistic and tracking

How to add statistic and tracking

All our buttons in theme has special class which can be used to track all clicks.

This is example of Analytics code. To use code, you need to have analytics script on your site. Then, add next to theme option – general – Js code for footer

<script>
jQuery(document).ready(function($) {
  'use strict';
     $(".re_track_btn").on('click', function(event){
        ga('send', 'event', {
    	eventCategory: 'Outbound Link',
    	eventAction: 'click',
    	eventLabel: event.target.href
        });
     });
});
</script>

This code will add Event tracking, Event category – Outbound Link, Action – click, Label will be url of link.

More about Event tracking and where to see them read in google docs