I am using the photoswipe js for my mobile web photo gallery but i need to know the number of views I had, so trying to include my google analytics into the gallery but somehow it only can capture 1 view but is there a way that i can had a callback event to load the google analytics? so every image the user view there is a view? is there an expert out there can help me who is a non-programmer.
Asked
Active
Viewed 283 times
1 Answers
0
I don't know what code you are expecting to see but you could use PhotoSwipe.EventTypes, if you have the photoSwipe examples in this one 06-events.html you have the eventTypes, there is one called on onDisplayImage, and in this event you can use the analytics code for virtual pageviews http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55529 and it will do the trick. Be sure you don't send twice the pageview tracking, sometimes onDisplayImage it is called more than once.
I hope this helped you.

jonaypelluz
- 368
- 4
- 13