Tracking Event Google Analytics

0

Hello, I have a slider inside the site and I would like to create a tracking event inside this slider. Within this slider has 6 images, so type up to which image the user was, which is the most viewed and cia. Can someone help me?

    
asked by anonymous 14.10.2015 / 15:54

1 answer

1

I do not know which slider plugin you're using, but it's very common that these plugins already have options for dealing with callbacks. Something like:

$(function() {
      $('#slides').slidesjs({
        width: 940,
        height: 528,
        callback: {
          complete: function(number) {
            console.log('O slide mostrado é o número ' + number);
          }
        }
      });
    });

You can use this callback to send an event to GA every time the transition is completed.

callback: {
          complete: function(number) {
            ga('send', 'event', 'home', 'impressao', 'slider', number);
          }
        }

So you can see which image had the most impressions using number as an identifier or even assigning the image name to the event label.

    
19.11.2015 / 15:25