Use Google Analytics to track Events in Slider Revolution 5

Learn how to easily track Events (Clicks, etc.) in Slider revolution 5 for WordPress with Google Analytics.

If you want to track your clicks in SLider Revolution 5 for WordPress then this tutorial will show you step by step how to achieve this. Great if you’re using a large hero image on a landing page or selling goods directly from Slider Revolution.

Grab the Javascript code here:

Track Individual Clicks

 

jQuery('body').on('click', '.ga-button', function() {

var $this = jQuery(this),
data = $this.attr('data-link') || $this.attr('href');

if(!data) {

data = $this.attr('data-actions');
if(data) data = data[0].url;
if(!data) data = $this.attr('id');

}

// __ga('send', 'event', 'outbound', 'click', data, {'transport': 'beacon'});
__gaTracker('send', 'event', 'outbound', 'click', data, {'transport': 'beacon'});

});

 

Track Click Events for Entire Slide

jQuery(window).on('load', function() {

jQuery('.rev_slider').each(function() {

var ids = jQuery(this).attr('id').split('rev_slider_')[1].split('_')[0],
api = eval('revapi' + ids);

api.on('revolution.slide.onchange', function(e, data) {

var data = 'Slider ' + ids + ' changed to slide #' + data.slideIndex;
// __ga('send', 'event', 'outbound', 'click', data, {'transport': 'beacon'});
__gaTracker('send', 'event', 'outbound', 'click', data, {'transport': 'beacon'});

});

});

});

 

Free tutorials for WordPress, Slider Revolution and Visual Composer. New tutorials added every Wednesday.

Take your WordPress website and skills to the next level!

AFFILIATE DOWNLOADS
If you like what we do and would like to support us, please consider using these affiliate links when purchasing any of the plugins covered in our tutorials. Thank you for your support.

CSSHERO:

ELEMENTOR PRO:

SLIDER REVOLUTION 5 –

VISUAL COMPOSER:

IMPREZA THEME:

SUBSCRIBE

LETS CONNECT:
https://twitter.com/WPTutz

SUPPORT: Our website offers additional information and perks. Please check it out! https://wptuts.co.uk