I have an image gallery with thumbnails that can be scrolled and clicked to expand. That click-to-expand can be tracked. However once the image is full screen, it can be zoomed in (using http://photoswipe.com) and the zooming is not tracked. How can that be done? I’m using this code.
Not sure as I do not know photoswipe but if your interaction is happening outside of your website which may be the case here, then you need to look at photoswipe API in order to send interactions from there to your Piwik server.
@RonanChardonneau photoswipe is no external service, but just a javascript library which shows a nice gallery (example)
@Maxi, you may look into Event Tracking. That way you can track every time this event happens.
e.g.
pswp.listen('initialZoom', function() {
_paq.push(['trackEvent', 'Gallery', 'Interaction', 'Open']); // you can set category, action and name however you want
});
You can put it into your application code to the Reston photoswipe specific JavaScript.
It doesn’t even matter if it is executed before or after piwik has initialised.
In this line the photoswipe object gets created and assigned to the variable gallery.
So you can put the event listeners in the following line:
gallery.listen('initialZoom', function() {
_paq.push(['trackEvent', 'Gallery', 'Interaction', 'Open']); // you can set category, action and name however you want
});
gallery.listen('initialZoomOut', function() {
_paq.push(['trackEvent', 'Gallery', 'Interaction', 'Close']); // you can set category, action and name however you want
});
Your solution from “Track both Show and Hide events” doesn’t track photoswipe interaction, but just when a user clicks on the link.