Class: Umami::Client
- Inherits:
-
Object
- Object
- Umami::Client
- Defined in:
- lib/umami/client.rb
Overview
The Client class provides methods to interact with the Umami API.
Instance Attribute Summary collapse
-
#request_timeout ⇒ Object
readonly
Returns the value of attribute request_timeout.
-
#uri_base ⇒ Object
readonly
Returns the value of attribute uri_base.
Instance Method Summary collapse
-
#add_team_user(team_id, user_id, role) ⇒ Hash
Add a user to a team.
-
#admin_teams(params = {}) ⇒ Hash
Get all teams (admin access required, self-hosted only).
-
#admin_users(params = {}) ⇒ Hash
Get all users (admin access required, self-hosted only).
-
#admin_websites(params = {}) ⇒ Hash
Get all websites (admin access required, self-hosted only).
-
#authenticate ⇒ void
Authenticate with the Umami API using username and password.
-
#cloud? ⇒ Boolean
Check if the client is configured for Umami Cloud.
-
#create_report(params = {}) ⇒ Hash
Create a new report.
-
#create_team(name) ⇒ Hash
Create a new team.
-
#create_user(username, password, role, id: nil) ⇒ Hash
Create a new user.
-
#create_website(params = {}) ⇒ Hash
Create a new website.
-
#delete_link(link_id) ⇒ Hash
Delete a link.
-
#delete_pixel(pixel_id) ⇒ Hash
Delete a pixel.
-
#delete_report(report_id) ⇒ Hash
Delete a report.
-
#delete_team(team_id) ⇒ Hash
Delete a team.
-
#delete_team_user(team_id, user_id) ⇒ Hash
Remove a user from a team.
-
#delete_user(user_id) ⇒ Hash
Delete a user.
-
#delete_website(website_id) ⇒ Hash
Delete a website.
-
#event_data_events(website_id, params = {}) ⇒ Object
deprecated
Deprecated.
Use #website_event_data_events instead
-
#event_data_fields(website_id, params = {}) ⇒ Object
deprecated
Deprecated.
Use #website_event_data_fields instead
-
#event_data_stats(website_id, params = {}) ⇒ Object
deprecated
Deprecated.
Use #website_event_data_stats instead
-
#initialize(options = {}) ⇒ Client
constructor
Initialize a new Umami API client.
-
#join_team(access_code) ⇒ Hash
Join a team.
-
#link(link_id) ⇒ Hash
Get a link by ID.
-
#links(params = {}) ⇒ Hash
Get all links.
-
#me ⇒ Hash
Get information about the current authenticated user.
-
#my_teams(params = {}) ⇒ Hash
Get all teams for the current authenticated user.
-
#my_websites(params = {}) ⇒ Hash
Get all websites for the current authenticated user.
-
#pixel(pixel_id) ⇒ Hash
Get a pixel by ID.
-
#pixels(params = {}) ⇒ Hash
Get all pixels.
-
#realtime(website_id) ⇒ Hash
Get realtime stats for a website (last 30 minutes).
-
#report(report_id) ⇒ Hash
Get a report by ID.
-
#report_attribution(params = {}) ⇒ Hash
Run an attribution report.
-
#report_breakdown(params = {}) ⇒ Hash
Run a breakdown report.
-
#report_funnel(params = {}) ⇒ Hash
Run a funnel report.
-
#report_goals(params = {}) ⇒ Hash
Run a goals report.
-
#report_journey(params = {}) ⇒ Hash
Run a journey report.
-
#report_retention(params = {}) ⇒ Hash
Run a retention report.
-
#report_revenue(params = {}) ⇒ Hash
Run a revenue report.
-
#report_utm(params = {}) ⇒ Hash
Run a UTM report.
-
#reports(params = {}) ⇒ Hash
Get all reports.
-
#reset_website(website_id) ⇒ Hash
Reset a website's data.
-
#self_hosted? ⇒ Boolean
Check if the client is configured for a self-hosted Umami instance.
-
#send_event(payload, user_agent: default_user_agent) ⇒ Hash
Send an event to Umami.
-
#team(team_id) ⇒ Hash
Get a team by ID.
-
#team_user(team_id, user_id) ⇒ Hash
Get a user in a team.
-
#team_users(team_id, params = {}) ⇒ Hash
Get all users in a team.
-
#team_websites(team_id, params = {}) ⇒ Hash
Get all websites for a team.
-
#teams(params = {}) ⇒ Hash
Get all teams.
-
#update_link(link_id, params = {}) ⇒ Hash
Update a link.
-
#update_pixel(pixel_id, params = {}) ⇒ Hash
Update a pixel.
-
#update_report(report_id, params = {}) ⇒ Hash
Update a report.
-
#update_team(team_id, params = {}) ⇒ Hash
Update a team.
-
#update_team_user(team_id, user_id, role) ⇒ Hash
Update a user's role in a team.
-
#update_user(user_id, params = {}) ⇒ Hash
Update a user.
-
#update_website(website_id, params = {}) ⇒ Hash
Update a website.
-
#user(user_id) ⇒ Hash
Get a user by ID.
-
#user_teams(user_id, params = {}) ⇒ Hash
Get all teams for a user.
-
#user_websites(user_id, params = {}) ⇒ Hash
Get all websites for a user.
-
#users(params = {}) ⇒ Hash
deprecated
Deprecated.
Use #admin_users instead
-
#verify_token ⇒ Hash
Verify the authentication token.
-
#website(website_id) ⇒ Hash
Get a website by ID.
-
#website_active_visitors(website_id) ⇒ Hash
Get active visitors for a website (last 5 minutes).
-
#website_event_data(website_id, event_id) ⇒ Array<Hash>
Get event data for an individual event.
-
#website_event_data_events(website_id, params = {}) ⇒ Array<Hash>
Get event data names, properties, and counts.
-
#website_event_data_fields(website_id, params = {}) ⇒ Array<Hash>
Get event data fields within a time range.
-
#website_event_data_properties(website_id, params = {}) ⇒ Array<Hash>
Get event name and property counts.
-
#website_event_data_stats(website_id, params = {}) ⇒ Array<Hash>
Get aggregated event statistics.
-
#website_event_data_values(website_id, params = {}) ⇒ Array<Hash>
Get event data value counts for a given event and property.
-
#website_events(website_id, params = {}) ⇒ Array<Hash>
Get website events within a time range.
-
#website_events_list(website_id, params = {}) ⇒ Hash
Get website event details within a time range (paginated list).
-
#website_events_series(website_id, params = {}) ⇒ Array<Hash>
Get website events series within a time range.
-
#website_metrics(website_id, params = {}) ⇒ Array<Hash>
Get website metrics.
-
#website_metrics_expanded(website_id, params = {}) ⇒ Array<Hash>
Get expanded website metrics with detailed engagement data.
-
#website_pageviews(website_id, params = {}) ⇒ Hash
Get website pageviews within a time range.
-
#website_session(website_id, session_id) ⇒ Hash
Get details for an individual session.
-
#website_session_activity(website_id, session_id, params = {}) ⇒ Array<Hash>
Get activity for an individual session.
-
#website_session_data_properties(website_id, params = {}) ⇒ Array<Hash>
Get session data property counts.
-
#website_session_data_values(website_id, params = {}) ⇒ Array<Hash>
Get session data value counts for a property.
-
#website_session_properties(website_id, session_id) ⇒ Array<Hash>
Get properties for an individual session.
-
#website_sessions(website_id, params = {}) ⇒ Hash
Get website sessions within a time range.
-
#website_sessions_stats(website_id, params = {}) ⇒ Hash
Get summarized session statistics.
-
#website_sessions_weekly(website_id, params = {}) ⇒ Array<Array>
Get session counts by hour of weekday.
-
#website_stats(website_id, params = {}) ⇒ Hash
Get website statistics.
-
#websites(params = {}) ⇒ Hash
Get all websites.
Constructor Details
#initialize(options = {}) ⇒ Client
Initialize a new Umami API client
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/umami/client.rb', line 19 def initialize( = {}) @config = [:config] || Umami.configuration @config.validate! # Validate the configuration before using it @uri_base = [:uri_base] || @config.uri_base @request_timeout = [:request_timeout] || @config.request_timeout @access_token = [:access_token] || @config.access_token @username = [:username] || @config.username @password = [:password] || @config.password authenticate if @access_token.nil? end |
Instance Attribute Details
#request_timeout ⇒ Object (readonly)
Returns the value of attribute request_timeout.
9 10 11 |
# File 'lib/umami/client.rb', line 9 def request_timeout @request_timeout end |
#uri_base ⇒ Object (readonly)
Returns the value of attribute uri_base.
9 10 11 |
# File 'lib/umami/client.rb', line 9 def uri_base @uri_base end |
Instance Method Details
#add_team_user(team_id, user_id, role) ⇒ Hash
Add a user to a team
315 316 317 |
# File 'lib/umami/client.rb', line 315 def add_team_user(team_id, user_id, role) post("/api/teams/#{team_id}/users", { userId: user_id, role: role }) end |
#admin_teams(params = {}) ⇒ Hash
Get all teams (admin access required, self-hosted only)
144 145 146 |
# File 'lib/umami/client.rb', line 144 def admin_teams(params = {}) get("/api/admin/teams", params) end |
#admin_users(params = {}) ⇒ Hash
Get all users (admin access required, self-hosted only)
120 121 122 |
# File 'lib/umami/client.rb', line 120 def admin_users(params = {}) get("/api/admin/users", params) end |
#admin_websites(params = {}) ⇒ Hash
Get all websites (admin access required, self-hosted only)
132 133 134 |
# File 'lib/umami/client.rb', line 132 def admin_websites(params = {}) get("/api/admin/websites", params) end |
#authenticate ⇒ void
This method returns an undefined value.
Authenticate with the Umami API using username and password
This method is called automatically when initializing the client if an access token is not provided. It sets the @access_token instance variable upon successful authentication.
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/umami/client.rb', line 66 def authenticate raise Umami::AuthenticationError, "Username and password are required for authentication" if @username.nil? || @password.nil? response = connection.post("/api/auth/login") do |req| req.body = { username: @username, password: @password }.to_json end data = JSON.parse(response.body) @access_token = data["token"] rescue Faraday::Error, JSON::ParserError => e raise Umami::AuthenticationError, "Authentication failed: #{e.}" end |
#cloud? ⇒ Boolean
Check if the client is configured for Umami Cloud
37 38 39 |
# File 'lib/umami/client.rb', line 37 def cloud? @uri_base == Umami::Configuration::UMAMI_CLOUD_URL end |
#create_report(params = {}) ⇒ Hash
Create a new report
1095 1096 1097 |
# File 'lib/umami/client.rb', line 1095 def create_report(params = {}) post("/api/reports", params) end |
#create_team(name) ⇒ Hash
Create a new team
241 242 243 |
# File 'lib/umami/client.rb', line 241 def create_team(name) post("/api/teams", { name: name }) end |
#create_user(username, password, role, id: nil) ⇒ Hash
Create a new user
158 159 160 161 162 |
# File 'lib/umami/client.rb', line 158 def create_user(username, password, role, id: nil) params = { username: username, password: password, role: role } params[:id] = id if id post("/api/users", params) end |
#create_website(params = {}) ⇒ Hash
Create a new website
388 389 390 |
# File 'lib/umami/client.rb', line 388 def create_website(params = {}) post("/api/websites", params) end |
#delete_link(link_id) ⇒ Hash
Delete a link
1022 1023 1024 |
# File 'lib/umami/client.rb', line 1022 def delete_link(link_id) delete("/api/links/#{link_id}") end |
#delete_pixel(pixel_id) ⇒ Hash
Delete a pixel
1066 1067 1068 |
# File 'lib/umami/client.rb', line 1066 def delete_pixel(pixel_id) delete("/api/pixels/#{pixel_id}") end |
#delete_report(report_id) ⇒ Hash
Delete a report
1126 1127 1128 |
# File 'lib/umami/client.rb', line 1126 def delete_report(report_id) delete("/api/reports/#{report_id}") end |
#delete_team(team_id) ⇒ Hash
Delete a team
291 292 293 |
# File 'lib/umami/client.rb', line 291 def delete_team(team_id) delete("/api/teams/#{team_id}") end |
#delete_team_user(team_id, user_id) ⇒ Hash
Remove a user from a team
346 347 348 |
# File 'lib/umami/client.rb', line 346 def delete_team_user(team_id, user_id) delete("/api/teams/#{team_id}/users/#{user_id}") end |
#delete_user(user_id) ⇒ Hash
Delete a user
204 205 206 |
# File 'lib/umami/client.rb', line 204 def delete_user(user_id) delete("/api/users/#{user_id}") end |
#delete_website(website_id) ⇒ Hash
Delete a website
419 420 421 |
# File 'lib/umami/client.rb', line 419 def delete_website(website_id) delete("/api/websites/#{website_id}") end |
#event_data_events(website_id, params = {}) ⇒ Object
Use #website_event_data_events instead
953 954 955 956 |
# File 'lib/umami/client.rb', line 953 def event_data_events(website_id, params = {}) warn "[DEPRECATION] `event_data_events` is deprecated. Use `website_event_data_events` instead." website_event_data_events(website_id, params) end |
#event_data_fields(website_id, params = {}) ⇒ Object
Use #website_event_data_fields instead
959 960 961 962 |
# File 'lib/umami/client.rb', line 959 def event_data_fields(website_id, params = {}) warn "[DEPRECATION] `event_data_fields` is deprecated. Use `website_event_data_fields` instead." website_event_data_fields(website_id, params) end |
#event_data_stats(website_id, params = {}) ⇒ Object
Use #website_event_data_stats instead
965 966 967 968 |
# File 'lib/umami/client.rb', line 965 def event_data_stats(website_id, params = {}) warn "[DEPRECATION] `event_data_stats` is deprecated. Use `website_event_data_stats` instead." website_event_data_stats(website_id, params) end |
#join_team(access_code) ⇒ Hash
Join a team
261 262 263 |
# File 'lib/umami/client.rb', line 261 def join_team(access_code) post("/api/teams/join", { accessCode: access_code }) end |
#link(link_id) ⇒ Hash
Get a link by ID
1000 1001 1002 |
# File 'lib/umami/client.rb', line 1000 def link(link_id) get("/api/links/#{link_id}") end |
#links(params = {}) ⇒ Hash
Get all links
991 992 993 |
# File 'lib/umami/client.rb', line 991 def links(params = {}) get("/api/links", params) end |
#me ⇒ Hash
Get information about the current authenticated user
85 86 87 |
# File 'lib/umami/client.rb', line 85 def me get("/api/me") end |
#my_teams(params = {}) ⇒ Hash
Get all teams for the current authenticated user
96 97 98 |
# File 'lib/umami/client.rb', line 96 def my_teams(params = {}) get("/api/me/teams", params) end |
#my_websites(params = {}) ⇒ Hash
Get all websites for the current authenticated user
106 107 108 |
# File 'lib/umami/client.rb', line 106 def my_websites(params = {}) get("/api/me/websites", params) end |
#pixel(pixel_id) ⇒ Hash
Get a pixel by ID
1045 1046 1047 |
# File 'lib/umami/client.rb', line 1045 def pixel(pixel_id) get("/api/pixels/#{pixel_id}") end |
#pixels(params = {}) ⇒ Hash
Get all pixels
1036 1037 1038 |
# File 'lib/umami/client.rb', line 1036 def pixels(params = {}) get("/api/pixels", params) end |
#realtime(website_id) ⇒ Hash
Get realtime stats for a website (last 30 minutes)
977 978 979 |
# File 'lib/umami/client.rb', line 977 def realtime(website_id) get("/api/realtime/#{website_id}") end |
#report(report_id) ⇒ Hash
Get a report by ID
1104 1105 1106 |
# File 'lib/umami/client.rb', line 1104 def report(report_id) get("/api/reports/#{report_id}") end |
#report_attribution(params = {}) ⇒ Hash
Run an attribution report
1142 1143 1144 |
# File 'lib/umami/client.rb', line 1142 def report_attribution(params = {}) post("/api/reports/attribution", params) end |
#report_breakdown(params = {}) ⇒ Hash
Run a breakdown report
1156 1157 1158 |
# File 'lib/umami/client.rb', line 1156 def report_breakdown(params = {}) post("/api/reports/breakdown", params) end |
#report_funnel(params = {}) ⇒ Hash
Run a funnel report
1171 1172 1173 |
# File 'lib/umami/client.rb', line 1171 def report_funnel(params = {}) post("/api/reports/funnel", params) end |
#report_goals(params = {}) ⇒ Hash
Run a goals report
1186 1187 1188 |
# File 'lib/umami/client.rb', line 1186 def report_goals(params = {}) post("/api/reports/goals", params) end |
#report_journey(params = {}) ⇒ Hash
Run a journey report
1202 1203 1204 |
# File 'lib/umami/client.rb', line 1202 def report_journey(params = {}) post("/api/reports/journey", params) end |
#report_retention(params = {}) ⇒ Hash
Run a retention report
1216 1217 1218 |
# File 'lib/umami/client.rb', line 1216 def report_retention(params = {}) post("/api/reports/retention", params) end |
#report_revenue(params = {}) ⇒ Hash
Run a revenue report
1231 1232 1233 |
# File 'lib/umami/client.rb', line 1231 def report_revenue(params = {}) post("/api/reports/revenue", params) end |
#report_utm(params = {}) ⇒ Hash
Run a UTM report
1244 1245 1246 |
# File 'lib/umami/client.rb', line 1244 def report_utm(params = {}) post("/api/reports/utm", params) end |
#reports(params = {}) ⇒ Hash
Get all reports
1081 1082 1083 |
# File 'lib/umami/client.rb', line 1081 def reports(params = {}) get("/api/reports", params) end |
#reset_website(website_id) ⇒ Hash
Reset a website's data
428 429 430 |
# File 'lib/umami/client.rb', line 428 def reset_website(website_id) post("/api/websites/#{website_id}/reset") end |
#self_hosted? ⇒ Boolean
Check if the client is configured for a self-hosted Umami instance
44 45 46 |
# File 'lib/umami/client.rb', line 44 def self_hosted? !cloud? end |
#send_event(payload, user_agent: default_user_agent) ⇒ Hash
No authentication required. Uses https://cloud.umami.is for Umami Cloud.
Send an event to Umami
This method uses a separate connection that:
- Does NOT include Authorization header (not required for /api/send)
- Uses https://cloud.umami.is for Umami Cloud (different from the main API URL)
- Includes a User-Agent header (mandatory per API docs)
1273 1274 1275 |
# File 'lib/umami/client.rb', line 1273 def send_event(payload, user_agent: default_user_agent) send_post("/api/send", { type: "event", payload: payload }, user_agent: user_agent) end |
#team(team_id) ⇒ Hash
Get a team by ID
270 271 272 |
# File 'lib/umami/client.rb', line 270 def team(team_id) get("/api/teams/#{team_id}") end |
#team_user(team_id, user_id) ⇒ Hash
Get a user in a team
325 326 327 |
# File 'lib/umami/client.rb', line 325 def team_user(team_id, user_id) get("/api/teams/#{team_id}/users/#{user_id}") end |
#team_users(team_id, params = {}) ⇒ Hash
Get all users in a team
304 305 306 |
# File 'lib/umami/client.rb', line 304 def team_users(team_id, params = {}) get("/api/teams/#{team_id}/users", params) end |
#team_websites(team_id, params = {}) ⇒ Hash
Get all websites for a team
359 360 361 |
# File 'lib/umami/client.rb', line 359 def team_websites(team_id, params = {}) get("/api/teams/#{team_id}/websites", params) end |
#teams(params = {}) ⇒ Hash
Get all teams
252 253 254 |
# File 'lib/umami/client.rb', line 252 def teams(params = {}) get("/api/teams", params) end |
#update_link(link_id, params = {}) ⇒ Hash
Update a link
1013 1014 1015 |
# File 'lib/umami/client.rb', line 1013 def update_link(link_id, params = {}) post("/api/links/#{link_id}", params) end |
#update_pixel(pixel_id, params = {}) ⇒ Hash
Update a pixel
1057 1058 1059 |
# File 'lib/umami/client.rb', line 1057 def update_pixel(pixel_id, params = {}) post("/api/pixels/#{pixel_id}", params) end |
#update_report(report_id, params = {}) ⇒ Hash
Update a report
1117 1118 1119 |
# File 'lib/umami/client.rb', line 1117 def update_report(report_id, params = {}) post("/api/reports/#{report_id}", params) end |
#update_team(team_id, params = {}) ⇒ Hash
Update a team
282 283 284 |
# File 'lib/umami/client.rb', line 282 def update_team(team_id, params = {}) post("/api/teams/#{team_id}", params) end |
#update_team_user(team_id, user_id, role) ⇒ Hash
Update a user's role in a team
336 337 338 |
# File 'lib/umami/client.rb', line 336 def update_team_user(team_id, user_id, role) post("/api/teams/#{team_id}/users/#{user_id}", { role: role }) end |
#update_user(user_id, params = {}) ⇒ Hash
Update a user
195 196 197 |
# File 'lib/umami/client.rb', line 195 def update_user(user_id, params = {}) post("/api/users/#{user_id}", params) end |
#update_website(website_id, params = {}) ⇒ Hash
Update a website
410 411 412 |
# File 'lib/umami/client.rb', line 410 def update_website(website_id, params = {}) post("/api/websites/#{website_id}", params) end |
#user(user_id) ⇒ Hash
Get a user by ID
182 183 184 |
# File 'lib/umami/client.rb', line 182 def user(user_id) get("/api/users/#{user_id}") end |
#user_teams(user_id, params = {}) ⇒ Hash
Get all teams for a user
230 231 232 |
# File 'lib/umami/client.rb', line 230 def user_teams(user_id, params = {}) get("/api/users/#{user_id}/teams", params) end |
#user_websites(user_id, params = {}) ⇒ Hash
Get all websites for a user
218 219 220 |
# File 'lib/umami/client.rb', line 218 def user_websites(user_id, params = {}) get("/api/users/#{user_id}/websites", params) end |
#users(params = {}) ⇒ Hash
Use #admin_users instead
Get all users (admin access required)
173 174 175 |
# File 'lib/umami/client.rb', line 173 def users(params = {}) admin_users(params) end |
#verify_token ⇒ Hash
Verify the authentication token
52 53 54 |
# File 'lib/umami/client.rb', line 52 def verify_token post("/api/auth/verify") end |
#website(website_id) ⇒ Hash
Get a website by ID
397 398 399 |
# File 'lib/umami/client.rb', line 397 def website(website_id) get("/api/websites/#{website_id}") end |
#website_active_visitors(website_id) ⇒ Hash
Get active visitors for a website (last 5 minutes)
465 466 467 |
# File 'lib/umami/client.rb', line 465 def website_active_visitors(website_id) get("/api/websites/#{website_id}/active") end |
#website_event_data(website_id, event_id) ⇒ Array<Hash>
Get event data for an individual event
813 814 815 |
# File 'lib/umami/client.rb', line 813 def website_event_data(website_id, event_id) get("/api/websites/#{website_id}/event-data/#{event_id}") end |
#website_event_data_events(website_id, params = {}) ⇒ Array<Hash>
Get event data names, properties, and counts
840 841 842 |
# File 'lib/umami/client.rb', line 840 def website_event_data_events(website_id, params = {}) get("/api/websites/#{website_id}/event-data/events", params) end |
#website_event_data_fields(website_id, params = {}) ⇒ Array<Hash>
Get event data fields within a time range
866 867 868 |
# File 'lib/umami/client.rb', line 866 def website_event_data_fields(website_id, params = {}) get("/api/websites/#{website_id}/event-data/fields", params) end |
#website_event_data_properties(website_id, params = {}) ⇒ Array<Hash>
Get event name and property counts
892 893 894 |
# File 'lib/umami/client.rb', line 892 def website_event_data_properties(website_id, params = {}) get("/api/websites/#{website_id}/event-data/properties", params) end |
#website_event_data_stats(website_id, params = {}) ⇒ Array<Hash>
Get aggregated event statistics
946 947 948 |
# File 'lib/umami/client.rb', line 946 def website_event_data_stats(website_id, params = {}) get("/api/websites/#{website_id}/event-data/stats", params) end |
#website_event_data_values(website_id, params = {}) ⇒ Array<Hash>
Get event data value counts for a given event and property
920 921 922 |
# File 'lib/umami/client.rb', line 920 def website_event_data_values(website_id, params = {}) get("/api/websites/#{website_id}/event-data/values", params) end |
#website_events(website_id, params = {}) ⇒ Array<Hash>
Get website events within a time range
This method returns event data with optional time-series grouping. For paginated event lists with search, use #website_events_list instead.
511 512 513 |
# File 'lib/umami/client.rb', line 511 def website_events(website_id, params = {}) get("/api/websites/#{website_id}/events", params) end |
#website_events_list(website_id, params = {}) ⇒ Hash
Get website event details within a time range (paginated list)
This method returns a paginated list of individual events with full details and supports search and filtering. For time-series grouped event data, use #website_events or #website_events_series instead.
803 804 805 |
# File 'lib/umami/client.rb', line 803 def website_events_list(website_id, params = {}) get("/api/websites/#{website_id}/events", params) end |
#website_events_series(website_id, params = {}) ⇒ Array<Hash>
Get website events series within a time range
538 539 540 |
# File 'lib/umami/client.rb', line 538 def website_events_series(website_id, params = {}) get("/api/websites/#{website_id}/events/series", params) end |
#website_metrics(website_id, params = {}) ⇒ Array<Hash>
Get website metrics
567 568 569 |
# File 'lib/umami/client.rb', line 567 def website_metrics(website_id, params = {}) get("/api/websites/#{website_id}/metrics", params) end |
#website_metrics_expanded(website_id, params = {}) ⇒ Array<Hash>
Get expanded website metrics with detailed engagement data
596 597 598 |
# File 'lib/umami/client.rb', line 596 def (website_id, params = {}) get("/api/websites/#{website_id}/metrics/expanded", params) end |
#website_pageviews(website_id, params = {}) ⇒ Hash
Get website pageviews within a time range
493 494 495 |
# File 'lib/umami/client.rb', line 493 def website_pageviews(website_id, params = {}) get("/api/websites/#{website_id}/pageviews", params) end |
#website_session(website_id, session_id) ⇒ Hash
Get details for an individual session
690 691 692 |
# File 'lib/umami/client.rb', line 690 def website_session(website_id, session_id) get("/api/websites/#{website_id}/sessions/#{session_id}") end |
#website_session_activity(website_id, session_id, params = {}) ⇒ Array<Hash>
Get activity for an individual session
703 704 705 |
# File 'lib/umami/client.rb', line 703 def website_session_activity(website_id, session_id, params = {}) get("/api/websites/#{website_id}/sessions/#{session_id}/activity", params) end |
#website_session_data_properties(website_id, params = {}) ⇒ Array<Hash>
Get session data property counts
739 740 741 |
# File 'lib/umami/client.rb', line 739 def website_session_data_properties(website_id, params = {}) get("/api/websites/#{website_id}/session-data/properties", params) end |
#website_session_data_values(website_id, params = {}) ⇒ Array<Hash>
Get session data value counts for a property
766 767 768 |
# File 'lib/umami/client.rb', line 766 def website_session_data_values(website_id, params = {}) get("/api/websites/#{website_id}/session-data/values", params) end |
#website_session_properties(website_id, session_id) ⇒ Array<Hash>
Get properties for an individual session
713 714 715 |
# File 'lib/umami/client.rb', line 713 def website_session_properties(website_id, session_id) get("/api/websites/#{website_id}/sessions/#{session_id}/properties") end |
#website_sessions(website_id, params = {}) ⇒ Hash
Get website sessions within a time range
627 628 629 |
# File 'lib/umami/client.rb', line 627 def website_sessions(website_id, params = {}) get("/api/websites/#{website_id}/sessions", params) end |
#website_sessions_stats(website_id, params = {}) ⇒ Hash
Get summarized session statistics
653 654 655 |
# File 'lib/umami/client.rb', line 653 def website_sessions_stats(website_id, params = {}) get("/api/websites/#{website_id}/sessions/stats", params) end |
#website_sessions_weekly(website_id, params = {}) ⇒ Array<Array>
Get session counts by hour of weekday
680 681 682 |
# File 'lib/umami/client.rb', line 680 def website_sessions_weekly(website_id, params = {}) get("/api/websites/#{website_id}/sessions/weekly", params) end |
#website_stats(website_id, params = {}) ⇒ Hash
Get website statistics
456 457 458 |
# File 'lib/umami/client.rb', line 456 def website_stats(website_id, params = {}) get("/api/websites/#{website_id}/stats", params) end |
#websites(params = {}) ⇒ Hash
Get all websites
374 375 376 |
# File 'lib/umami/client.rb', line 374 def websites(params = {}) get("/api/websites", params) end |