Single page app - form each field time spent

Avatar

Avatar
Validate 25
Level 3
m_1985
Level 3

Likes

15 likes

Total Posts

56 posts

Correct reply

3 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 1
Give Back
View profile

Avatar
Validate 25
Level 3
m_1985
Level 3

Likes

15 likes

Total Posts

56 posts

Correct reply

3 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 1
Give Back
View profile
m_1985
Level 3

09-08-2016

Hi,

Is there a way to get amount of time spent on form each fields.?  any recommendations. 

update: the below code seems to be working by getting the name of the field and field timing on the browser console. But, it doesnt seem to be working when i include this code in DTM. I could understand sine the page is not reloading and that's the reason it is not working. Any help would be greatly appreciated

$(document).ready(function() {         
     var d=0;
     var t=0;
     $(':input').focus(function () {
     d=new Date();
     t =d.getTime();
                });
    $(':input').blur(function() {
    var e=new Date();
    var x = e.getTime();
    var exit = Math.round((x - t)/1000);
        var formPage = document.title;
                if($(this).val().length > 0){ 
                console.log($(this).attr('name'));
                console.log(exit);
    } 
        
    });
});

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

12-08-2016

Hi ,

We tried a similar thing at our end and included the time on field code which you provided in a  "Global Page Load Rule "  as a "Sequential Javascript" under  tab " Javascript / Third Party tag " and it was working and the time spent on a field was getting printed on the console.

Please find attached  snapshots for your reference and we would recommend to try out the same thing at your end and le tus know whether the same thing works for you or not

Thanks & Regards

Parit Mittal

Answers (0)