Closed nestorw closed 5 years ago
Terms we need definitions and crosswalks for:
Here's some info from Google. Note things have changed between v3 and v4 of GA Reporting API, because of course they have..
Metrics:
ga:users
= The total number of users for the requested time period. Formerly knows as ga:visitors
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.
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)
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)
@nestorw :point_up: does that look right to you?
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
looks correct to me