Git Product home page Git Product logo

google-api-cake-plugin's Introduction

Google API Cake Plugin

Currently I've only build in support for Google Analytics but you could easily modify it to support other Google APIs. If you add further support please feel free to help by contributing to this project. If you have any questions or comments you can email me at [email protected].

Google API Setup

  1. Go to: Google APIs
  2. Create a Client ID of type Service account
  3. Download the newly created p12 file, title it googlekey.p12 and place it into the main "Config" folder.
  4. The new service account will also have:
    • Client ID which is GOOGLE_CLIENT_ID
    • Email Address which is GOOGLE_SERVICE_ACCOUNT_NAME
  5. You'll also need the GOOGLE_ANALYTICS_ACCOUNT_ID this can be found within the Analytics account
    • Navigate to the profile you want to query
    • Find the Profile ID on the profile settings page
  6. You may get an error that the account does not have an analytics account, you need to add the GOOGLE_SERVICE_ACCOUNT_NAME as a user within your analytics account so we can get access to the profile
  7. More information can be found at Google API Reference Documentation

Cake Setup

  1. Add the following code to your local bootstrap with the information gathered from the above steps:

     define('GOOGLE_ANALYTICS_ACCOUNT_ID', 'XXXXXXX');
     define('GOOGLE_CLIENT_ID', 'Client ID');
     define('GOOGLE_SERVICE_ACCOUNT_NAME', 'Email Address');
    
  2. You can then add shell scripts to periodically (on a cronjob) cache data from google analytics via shell command. An example can be seen here Console/Command/AnalyticsShell.php.example, demonstrating how you might update a model view count based on it's path/slug.

google-api-cake-plugin's People

Contributors

reedd avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.