Can anyone suggest me for data import form Google Analytics


I have worked on intermediate project. Here they used 7 domains and
domains retrieved Google Analytics data properly.

Now i have create 3 new domains. It have records in Google Analitics but
can’t get the result form GA to our site. i got empty array for this 3

Gem: gem ‘google-api-client’

def self.pull_all
ending = - 1
puts “Ending date: #{ending.to_s}”

self.all.each do |view|
  beginning = Date.parse(view.daily_view_metrics.any? ?

(view.daily_view_metrics.order(“date DESC”) + 1).to_s :
next if beginning >= ending
(beginning…ending).each do |day|

previously i am not working in Google Analytics so anyone guide me.

Here is the way how I import data from Google Analytics:

First Step: Sign in to Google Analytics.
Second Step: Click Admin, and navigate to the property to which you want to upload the data.
Third Step: In the PROPERTY column, click Data Import. This displays the Data Sets page.
Four Step: Select an existing Data Set or create a new one to hold your imported data

If you are interested to know about a data science course to make a career in it then join the best Data science online training and build your career in it.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs