AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

4.1K members online now
4.1K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
Guide Me

How to set custme dimension and metric

Follower ✭ ✭ ☆
# 1
Follower ✭ ✭ ☆

Hi Guys,


Video play duration using google analytic custom metric.


While using custom metric I'm getting below code.

var metricValue = '123';
ga('set', 'metric1', metricValue);


So please, let me know where to use this code and what to use in custom metric code suggested by google for video play duration.


1 Expert replyverified_user

How to set custme dimension and metric

Rising Star
# 2
Rising Star

Hi Riyaj,


You have to have a developer to create a listener to calculate the play duration value for you and then pass to the code you have here.   You could also pass it in as in integer into an event value instead.




Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn