简体   繁体   中英

Connecting to the Google Analytics API

I am trying to connect to the Google Analytics api. My ultimate goal is to add a goal automatically, but I cannot even HelloAnalytics to work. I have followed the explicit tutorial here .

My require once did not work at first because the tutorial links to paths that cannot be found. So I had to make a guess at which files to link to. I tried the following:

require_once '/classes/google-api-php/src/Google/Client.php';
require_once '/classes/google-api-php/src/Google/Service/Analytics.php';

I then get the following error:

Fatal error: Class 'Google_Service' not found in C:\\xampp\\htdocs\\google-api-test\\classes\\google-api-php\\src\\Google\\Service\\Analytics.php on line 32

I have a feeling the tutorial needs to be updated to match the library. At the moment I am stuck confused.

SOLVED: The author of the post: daimto.com/google-oauth2-php , has replied to a comment. She has updated the post. It now works. I receive data back.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM