Use Google Analytics to keep track of images viewed

Touch Gallery now includes a very simple event triggered whenever an image is viewed.

The event is tg.imageViewed

it includes 4 parameters:

total - the number of images in the gallery file - the relative path to the current image (if the image is resized that'll be the image from the cache) title - the file's title attribute value if set desc - the file's description attribute value if set index - the current image's index in the list of images Using with Google Analytics is pretty simple. Let's say you want to trigger a GA event and reference the image's title when it happens. Just do:

$(document).on('tg.imageViewed', function(e) { ga('send', 'event', 'gallery', 'image viewed', e.title); }); Of course, this is just an example. You can use whatever values you want.