samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
184 stars 124 forks source link

Matomo vs GA terminology #2850

Closed nestorw closed 5 years ago

nestorw commented 6 years ago
screen shot 2018-03-27 at 12 18 50 pm
vantuyls commented 6 years ago

Terms we need definitions and crosswalks for:

mcritchlow commented 6 years ago

Here's some info from Google. Note things have changed between v3 and v4 of GA Reporting API, because of course they have..

https://developers.google.com/analytics/devguides/reporting/core/dimsmets#view=detail&group=user&jump=ga_visitors

Metrics:

  1. ga:users = The total number of users for the requested time period. Formerly knows as ga:visitors
  2. ga:newUser = The number of sessions marked as a user's first sessions. Formerly knows as ga:newVisits

Edit: also here's a gist i wrote up with some sample queries https://gist.github.com/mcritchlow/0fc999de486182065b1d2a5402e33ecd note that i'm not querying against a hyrax app but our library public website. so yeah.

vantuyls commented 6 years ago

Visitor - An individual person who visits the repository - this is sometimes referred to as User

Session - a repository usage event (e.g. a user visiting the repository and interacting with content in some way)

mcritchlow commented 6 years ago

Ok, so if I'm understanding this correctly, we need to update our resource statistic table which currently is:

    create_table :resource_stats do |t|
      t.datetime :date, null: false
      t.integer :user_id
      t.integer :downloads
      t.integer :pageviews
      t.integer :unique_visitors
      t.integer :returning_visitors
      t.string :resource_id
      t.string :resource_type

      t.timestamps
    end
    add_index :resource_stats, :date
    add_index :resource_stats, [:date, :resource_id, :resource_type]

And it should be:

    create_table :resource_stats do |t|
      t.datetime :date, null: false
      t.integer :user_id
      t.integer :downloads
      t.integer :pageviews
      t.integer :visitors
      t.integer :sessions
      t.string :resource_id
      t.string :resource_type

      t.timestamps
    end
    add_index :resource_stats, :date
    add_index :resource_stats, [:date, :resource_id, :resource_type]

Is that right? If so, I'll setup a ticket and get a DB migration in place or update the existing one since it's not actually merged anywhere (yet)

mcritchlow commented 6 years ago

@nestorw :point_up: does that look right to you?

mcritchlow commented 6 years ago

For now I'm going to update the database migration for creating the table to align with what's above. if that turns out to be incorrect let's adjust as needed

nestorw commented 6 years ago

looks correct to me