Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update submodule #94

Merged
merged 4 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions app/services/hyrax/analytics/ga4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def base64?(value)
def account_json_string
return @account_json_string if @account_json_string
@account_json_string = if @config['account_json']
base64?(@config['account_json']) ? Base64.decode64(@config['account_json']) : @config['account_json']
else
File.read(@config['account_json_path'])
end
base64?(@config['account_json']) ? Base64.decode64(@config['account_json']) : @config['account_json']
else
File.read(@config['account_json_path'])
end
end

def account_info
Expand Down Expand Up @@ -176,31 +176,31 @@ def unique_visitors_for_id(id, date = default_date_range); end

def new_visitors(period = 'month', date = default_date_range)
start_date, end_date = date_period(period, date)
Visits.new(start_date: start_date, end_date: end_date).new_visits
Visits.new(start_date:, end_date:).new_visits
end

def new_visits_by_day(date = default_date_range, period = 'range')
start_date, end_date = date_period(period, date)
VisitsDaily.new(start_date: start_date, end_date: end_date).new_visits
VisitsDaily.new(start_date:, end_date:).new_visits
end

def returning_visitors(period = 'month', date = default_date_range)
start_date, end_date = date_period(period, date)
Visits.new(start_date: start_date, end_date: end_date).return_visits
Visits.new(start_date:, end_date:).return_visits
end

def returning_visits_by_day(date = default_date_range, period = 'range')
start_date, end_date = date_period(period, date)
VisitsDaily.new(start_date: start_date, end_date: end_date).return_visits
VisitsDaily.new(start_date:, end_date:).return_visits
end

def total_visitors(period = 'month', date = default_date_range)
start_date, end_date = date_period(period, date)
Visits.new(start_date: start_date, end_date: end_date).total_visits
Visits.new(start_date:, end_date:).total_visits
end

def page_statistics(start_date, object)
visits = VisitsDaily.new(start_date: start_date, end_date: Date.yesterday)
visits = VisitsDaily.new(start_date:, end_date: Date.yesterday)
visits.add_filter(dimension: 'contentId', values: [object.id.to_s])
visits.total_visits
end
Expand Down
Loading