javascript - How to track the following event in the system? -


there sites has user system video watching function, check following, notice logined user view , need include user name @ track event:

a. if viewer finish watch entire video; , if number of videos viewed per visit / session?

b. if viewer signed ie conversion rate?

here guess:

a) track finish watching video

add track code @ video complete event

ga('send', 'event', 'videos', 'complete', '<?= $video_title; ?>' ); 

but whole session not sure above code have track

b) video viewer sign up

add @ video detail page:

if logined:

ga('send', 'event', 'videos', 'play', '<?= $video_title; ?>' ,1); 

if not logined

ga('send', 'event', 'videos', 'play', '<?= $video_title; ?>' ,0); 

the problem how add user name , , above track code can fulfill requirement?

thanks lot helping.

google analytics terms of use not allow track users username, because classed pii.

you can track user id using custom dimension providing id able meaningfully interpreted you.

you can add on pageview providing scope of dimension set user.

ga('send', 'pageview', {'dimension1': 'xyz123'});


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -