在Rails应用中连接到Google AnalyticsAPI [英] Connecting to Google Analytics API in a Rails app
问题描述
有没有好的教程可供参考:如何在Rails应用程序中与Google Analytics API交互?我发现
HTH
Is there a good tutorial available re: how to interact with the Google Analytics API within a Rails app? I've found this gist, but I'm not sure if every step listed in that gist is necessary.
If that is a good tutorial to follow, where can I download the "key_file" that's mentioned? I can't seem to find it within https://code.google.com/apis/console/. Also, where do I find out my API client email address / SERVICE ACCOUNT EMAIL?
I can certainly help you out with the key file and service account email. Google is really good at changing their documentation and procedures often and usually not in that order.
Create your project in the Google console: https://code.google.com/apis/console
Go to API's & Auth and turn off all but the Analytics API.
Go to Credentials (under API's) and click Create a New Client ID.
Select Service Account from the pop up.
Save the
.p12
file it will prompt you to download.The service account email address will be under the Service Account setting box as Email Address and be in the form of xxxxxxxxxxxxxx@developer.gserviceaccount.com (the really long email)
Add this email to the Google analytics profile(s) as a user with Read & Analyze access.
You should now have all the pieces you need to use service account access once you find that Rails tut.
As far as you Rails app goes, I found this (you may have as well): Google Analytics API Client Library for Ruby
HTH
这篇关于在Rails应用中连接到Google AnalyticsAPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!