Ruby on Rails
Thursday, February 4, 2016
Hi,
-- I have worked on intermediate project. Here they used 7 domains and each domains retrieved Google Analytics data properly.
Now i have create 3 new domains. It have records in Google Analitics but i can't get the result form GA to our site. i got empty array for this 3 domains.
Gem: gem 'google-api-client'
def self.pull_all
ending = Date.today - 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").first.date + 1).to_s : "2014-10-01")
next if beginning >= ending
(beginning..ending).each do |day|
view.get_analytics(day)
view.save_analytics
end
end
end
previously i am not working in Google Analytics so anyone guide me.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJyTjnHk09JrtbXnT1b4of0hfhiTijOZbDRJitg0512OUXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment