This recipe discusses how to track which images are viewed with Google Analytics.
To get us started, we create a new
ga-example.html file inside our
development directory. Include a couple of sample images so that we can inspect the Google Analytics tracking requests being sent.
The basic HTML structure will look like the following code snippet with the normal Google Analytics code at the bottom of the file:
<!DOCTYPE html> <html lang="en"> <head> <script src="http://code.jquery.com/jquery.min.js"> </script> <script src="../galleria-1.2.8.min.js"></script> <script> /* Galleria initialization */ </script> </head> <body> <!-- Galleria HTML definition --> <div id="galleria" style="height: ...