Expand my Community achievements bar.

Time Spent

Avatar

Level 2

Hi 
I have a dimension of evar type where the time is mentioned in microsecond. Attached is the screenshot where it shows time spent in cart for a session id.

There can be multiple  time frames for one session id, depending the number of items in cart etc.
How can i convert it to metric as a sum of all the time frames ?

I want something like -- 76254353 (session id) -- 54000 (time spent in cart)
Please find attached the sample for a session id.

4 Replies

Avatar

Community Advisor and Adobe Champion

Unfortunately, in Adobe Analytics dimensions are stored as text... there is no way to convert them to a metric.

 

Now, depending on your use case, you might try setting up a "Numeric Event" where you pass a numeric value into an event (as opposed to a standard counter that increments by 1).

 

So let's say you set up Event5 as a Numeric Event

Jennifer_Dungan_0-1719503333293.png

 

 

Now, in your implementation, you would either send this manually:

s.events = "event5=54000";

 

or in your Extension:

Jennifer_Dungan_1-1719503429457.png

or more likely, you would be using a Data Element:

Jennifer_Dungan_2-1719503476190.png

 

This would roll up the total time across all values for all users, or for the specific user, or even against the specific session id....

 

Try this in a QA/Dev environment and see if something like this would work for you.

 

 

Now, if you have CJA, there is a feature to make a metric from a dimension, but I am guessing that you are on AA and not CJA....

Avatar

Level 3

hi @Jennifer_Dungan

 

From what I understood from Varun's statement is that he was trying to bucket by timestamp(1-3,3-5,5-10 so on) and quantify, and appending when more than 1 val was limitation.

 

But when you suggest switching to numeric metric, that solves summing up values. To clarify from the reporting needs - if event5 triggered twice on a session ID 123, then for this session ID row, event 5 would show X+Y.

 

But how to get the view of total users by timespent buckets, like if it was dimension( w/ classification)? Thanks Champ

Avatar

Community Advisor and Adobe Champion

@abhijithr There was nothing in the the question about bucketing, and the one question was pretty much:

 

How can i convert it to metric as a sum of all the time frame

using the terms "metric" and "sum"... that sounds like Varun needs this stored as a number (that will add up, and be able to do math on, etc), and the only way to do that is with an event... and the answer to that is basically, don't send it to Adobe in a dimension, send it directly as a metric.... 

 

If this isn't what Varun needs, then hopefully they can provide more details about their needs.

Avatar

Level 2

Hi @abhijithr 

 

Thanks a lot for your comment, i am only looking to sum up the "time frames". each session id can have multiple time frames.