-
Notifications
You must be signed in to change notification settings - Fork 0
Analytics research questions
Which tooltips are being clicked and how often?
The tooltip clicked event is recorded in tooltips_controller.js whenever the user clicks a tooltip.
Recording this event is enabled by the ahoy.tooltip setting.
Which tooltips have been clicked?
> Ahoy::Event.where_event("tooltip clicked").group_prop(:tooltip).count
=> {"Link for sharing"=>3}
How many visitors have been clicking tooltips?
> Ahoy::Event.where_event("tooltip clicked").joins(:visit).group('visit.visitor_token').count
=> {"aa3d213d-89e8-4186-ac30-7f323b6d396a"=>3}
What validation errors do users encounter?
The invalid work submitted event is recorded in WorksController when validation fails.
What are the most common validation errors?
> Ahoy::Event.where_event('invalid work submitted').pluck(:properties).inject(Hash.new(0)) do |counter, properties|
properties['errors'].each do |error|
counter[error] +=1
end
counter
end.sort_by {|k,v| -v}
=>
[["Contributor last_name: must provide a last name", 2],
["Work content: must have at least one file", 1],
["Work work_type: blank", 1],
["Contributor first_name: must provide a first name", 1],
["Keyword text: blank", 1]]
How many forms for a new work are abandoned after a user has uploaded a file or interacted with the form?
- The
work form startedevent is recorded when a new work form is displayed for the user. - The
work form completedevent is recorded when the user has submitted a valid form for saving or depositing. - The
form changedevent is recorded when the user makes a change to the form. - The
files uploadedevent is recorded when the user uploads files.
Recording form changed and files uploaded is enabled by the ahoy.form_changes setting.
> started_forms = Ahoy::Event.where_event('work form started').map {|event| event.properties['form_id']}
> started_forms.count
=> 5
> changed_forms = Ahoy::Event.where_event('form changed').map {|event| event.properties['form_id']}.uniq
> changed_forms.count
=> 2
> forms_with_uploads = Ahoy::Event.where_event('files uploaded').map {|event| event.properties['form_id']}.uniq
> forms_with_uploads.count
=> 1
> completed_forms = Ahoy::Event.where_event('work form completed').map {|event| event.properties['form_id']}
> completed_forms.count
=> 1
# forms that have been started and changed / files uploaded but not completed
> abandoned_forms = (started_forms.to_set & (changed_forms + forms_with_uploads).to_set) - completed_forms
> abandoned_forms.count
=> 2
- The
article form startedevent is recorded when a new article form is displayed for the user. - The
article form completedevent is recorded when the user has submitted a valid article form for saving or depositing.
> started_forms = Ahoy::Event.where_event('article form started').map {|event| event.properties['form_id']}
> started_forms.count
=> 5
> completed_forms = Ahoy::Event.where_event('article form completed').map {|event| event.properties['form_id']}
> completed_forms.count
=> 1
How long does it take a user to complete a new work form?
- The
work form startedevent is recorded when a new work form is displayed for the user. - The
work form completedevent is recorded when the user has submitted a valid form for saving or depositing.
> completed_events = Ahoy::Event.where_event('work form completed')
> completion_durations = completed_events.map do |completed_event|
started_event = Ahoy::Event.where_event('work form started', form_id: completed_event.properties['form_id']).first
completed_event.time - started_event.time
end
# average completion time (seconds)
> completion_durations.sum.to_f / completion_durations.length
=> 92.01933633333334
# median
> completion_durations.sort[completion_durations.length / 2]
=> 77.909358
How often are help links clicked?
The $click event is recorded when a help link is clicked. Links to be recorded are indicated by having a data-ahoy-track attribute. This is added automatically by the link_to_new_tab helper.
> Ahoy::Event.where_event('$click').group_prop(:href).count.sort_by {|key, value| -value }.to_h
=>
{"https://sdr.library.stanford.edu/documentation/license-options"=>3,
"https://sdr.library.stanford.edu/documentation"=>2,
"https://sdr.library.stanford.edu/documentation/purls-dois-and-orcid-ids"=>2,
"https://sdr.library.stanford.edu/news/spring-pilot-new-self-deposit-application"=>1}
Are shares being used? Which types? By who?
> Share.count
=> 42
> Share.group(:permission).count
=> {"view" => 5, "edit" => 1, "deposit" => 36}
> Share.joins(work: [:collection]).joins(:user).pluck('work.title', 'collection.title', :email_address, :permission)
=>
[["Testing file replacement and title", "Amy's Test Collection", "estanfor@stanford.edu", "view"],
["Making Sense of a Nonsensical World",
"Stanford University, Department of Art & Art History",
"kingl@stanford.edu",
"deposit"],
["This is a test object for the demo video at the end of work cycle 3.",
"Amy's Test Collection",
"hfrost@stanford.edu",
"deposit"],
...
How is the globus service besing used?
Creating a full CSV report is available as a rake task:
bundle exec rake reports:globus
druid,version,sunetid,deposit_started,deposit_completed,size,file_count
druid:fp872dt2114,1,mjgiarlo,2026-02-09 23:50:28 UTC,2026-02-09 23:54:09 UTC,9071,1
druid:yj266dg8563,1,mjgiarlo,2026-02-10 00:56:22 UTC,2026-02-10 00:59:51 UTC,9071,1
druid:yd923xb0225,1,amcollie,2026-02-24 21:35:17 UTC
druid:xs263tf2860,1,petucket,2026-03-03 17:40:18 UTC,2026-03-03 17:42:01 UTC,9071,1
druid:hk657bn9293,1,mjgiarlo,2026-03-04 18:51:06 UTC
druid:rx402yb3951,1,mjgiarlo,2026-03-04 19:15:29 UTC,2026-03-04 19:19:01 UTC,9071,1
druid:wk036ty9779,1,mjgiarlo,2026-03-04 19:45:56 UTC,2026-03-04 19:49:22 UTC,9071,1
druid:dn141fp9240,1,suntzu,2026-03-10 07:41:44 UTC,2026-03-10 07:45:35 UTC,9071,1
druid:vf289xz0528,1,suntzu,2026-03-10 08:27:23 UTC,2026-03-10 08:30:51 UTC,9071,1
druid:fy714zm2100,1,amcollie,2026-03-10 17:08:25 UTC,2026-03-10 17:12:03 UTC,9071,1
Ahoy::Event.where_event('globus created')
Returns basic event data like:
<Ahoy::Event:0x00007f344d60d5c8
id: 52588,
visit_id: 56243,
user_id: nil,
name: "globus created",
properties: {"druid" => "druid:pn205cj4887", "sunetid" => "awan005", "version" => 2, "work_id" => 7487},
time: "2026-02-24 03:00:19.642584000 +0000">
Ahoy::Event.where_event('globus staged')
Returns basic event data like:
<Ahoy::Event:0x00007f344d60d5c8
id: 52588,
visit_id: 56243,
user_id: nil,
name: "globus created",
properties: {"druid" => "druid:pn205cj4887", "sunetid" => "awan005", "version" => 2, "work_id" => 7487, "file_count" => 8, "total_size" => 15616450580},
time: "2026-02-24 03:00:19.642584000 +0000">