I have a layer slider on my home page with 4 slides. Each slide contains an image with a link to a video that plays in a lightbox via the WP Video Lightbox plugin. How can I add code to this so that Google Analytics can track which slide is getting the most clicks for the video link? The site is http://www.brevium.com
Hi!
You’d need to put the link inside an HTML layer, something like this:
Best regards,
Josue
This seems to work in the layer slider preview, but the button does not show up on the actual site. Also, does the link here override what is in the main link tab in the editor?
Yes, you should remove the other link in the link tab. It seems to be working:
Cheers!
Josue
Sorry,,
a href=”http://www.youtube.com/embed/gHxRnvyOiRE?rel=0&autoplay=1&iframe=true&width=1000&height=560″ onClick=”_gaq.push([‘_trackEvent’, ‘slider’, ‘click’, ‘video’, ‘1’]);”)(img src=”http://www.brevium.com/wp-content/uploads/2014/04/find-out-btn.png”)/a>
It appears that the GA onclick event is conflicting with the WP Video Lightbox plugin.
Unfortunately we can’t do much about it because it’s not exactly a theme issue, you’d need to contact a developer to help you debug the code.
Cheers!
Josue