I have created event for video view and want to track how much time user has spent watching a video on my site. Let me know any code or formula by using custom metric and calculated metric.
2 Answers
You will need to send event hits to Google Analytics. There are plenty of resources online. It is too long to answer here so I have listed a couple of options using Google Tag Manager as a mediator. The below examples will track as events but you should follow a similar procedure if you wish to track to custom dimensions and custom metrics.
http://www.lunametrics.com/blog/2015/05/11/updated-youtube-tracking-google-analytics-gtm/

- 1,545
- 1
- 15
- 17
I Have already created event for video view using jw player in google analytic but that's only pass the video play not the duration of video play. I have also created custom metric for video play duration but how and where to use this code is looks difficult for me.
This is the code that GA has suggest me var metricValue = '123'; ga('set', 'metric1', metricValue);

- 1
- 2