module Similarweb::Traffic::TotalEngagement

Public Instance Methods

average_visit_duration(domain, start_date, end_date, granularity = 'daily') click to toggle source
# File lib/similarweb/traffic/total_engagement.rb, line 17
def average_visit_duration(domain, start_date, end_date, granularity = 'daily')
  response = self.http_client.get "v1/website/#{domain}/total-traffic-and-engagement/average-visit-duration?api_key=#{self.api_key}&start_date=#{start_date}&end_date=#{end_date}&main_domain_only=false&granularity=#{granularity}"
  JSON.parse(response.body)
end
bounce_rate(domain, start_date, end_date, granularity = 'daily') click to toggle source
# File lib/similarweb/traffic/total_engagement.rb, line 22
def bounce_rate(domain, start_date, end_date, granularity = 'daily')
  response = self.http_client.get "v1/website/#{domain}/total-traffic-and-engagement/bounce-rate?api_key=#{self.api_key}&start_date=#{start_date}&end_date=#{end_date}&main_domain_only=false&granularity=#{granularity}"
  JSON.parse(response.body)
end
pages_per_visit(domain, start_date, end_date, granularity = 'daily') click to toggle source
# File lib/similarweb/traffic/total_engagement.rb, line 12
def pages_per_visit(domain, start_date, end_date, granularity = 'daily')
  response = self.http_client.get "v1/website/#{domain}/total-traffic-and-engagement/pages-per-visit?api_key=#{self.api_key}&start_date=#{start_date}&end_date=#{end_date}&main_domain_only=false&granularity=#{granularity}"
  JSON.parse(response.body)
end
visit(domain, start_date, end_date, granularity = 'daily') click to toggle source

NOTE: start_date, end_date format: YYYY-MM

# File lib/similarweb/traffic/total_engagement.rb, line 7
def visit(domain, start_date, end_date, granularity = 'daily')
  response = self.http_client.get "v1/website/#{domain}/total-traffic-and-engagement/visits?api_key=#{self.api_key}&start_date=#{start_date}&end_date=#{end_date}&main_domain_only=false&granularity=#{granularity}"
  JSON.parse(response.body)
end