api - Google Analytics with CakePHP -
I am trying to get data from my Google analytic account, I have been using a plugin for KPHP and its I am
The plugin works, I can get a list of books from a specific author like the example.
I want to display some information for cake from my Google Analytical Account.
I have a few questions, how can I get Project_ID, IDs, secret?
CorePPP of my plugin:
$ Config = array ('GoogleAPI' => defines the option of array (/ ** * 'client' client) / 'Client' = & gt; array ('ApplicationName' = & gt; 'app', 'id' = & gt; '?', 'Secret' = & gt; '?', 'Developer key' & Gt; 'xxxxxxxxxxxxxxxxxxxx'),));
Test Controller:
& lt ;? Php AP :: Usage ('app controller', 'controller'); Class Test Controller AppController {Public $ component = array ('GoogleAPI.GoogleAPI' => Array ('service' => array ('analytics')); Public function index () {$ project_id = "Ga: xxxxxx"; $ Start_date = Date ('Y-M-D', Time () - 7 * 24 * 60 * 60); // 7 days ago $ end_date = Date ('Wi-M-D' $ (Metric = "ga: visits, GA: pageview"); $ dimension = "GA: browser"; $ OptParams = array ('dimension' = & gt; time) - 24 * 60 * 60; // 1 day ago $ Dimension); $ result = $ this- & gt; GoogleAPI- & gt; service ['Analytics'] - & gt; Data_ga- & gt; get ($ Project_id, $ start_date, $ end_date, $ metric, $ optpramams); var_dump ($ result);}}
In my index view, I get
GET Error calling: (401) login required
thanks
Comments
Post a Comment