2017 © Pedro Peláez
 

symfony-bundle google-api-client-bundle

A Symfony2 Wrapper for the Google APIs Client Library for PHP

image

rz/google-api-client-bundle

A Symfony2 Wrapper for the Google APIs Client Library for PHP

  • Saturday, July 30, 2016
  • by rmzamora
  • Repository
  • 0 Watchers
  • 1 Stars
  • 578 Installations
  • CSS
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

GoogleAPIClientBundle

The GoogleBundle adds the ability to add various Google services to your application. Currently Implemented: Google Analytics, Google Tag Manager and Client API, (*1)

STABLE VERSION, (*2)

Installation

Add the following to your composer.json file:, (*3)


{ "require": { "rz/google-api-client-bundle" : "1.0.*" } }

Install the libraries by running:, (*4)


composer install

If everything worked, the Google Bundle can now be found at vendor/rz/google-api-client-bundle., (*5)

Finally, be sure to enable the bundle in AppKernel.php by including the following:, (*6)


// app/AppKernel.php public function registerBundles() { $bundles = array( //... new Rz\GoogleAPIClientBundle\RzGoogleAPIClientBundle(), ); }

Configuration

Google Analytics, (*7)


rz_google_api_client: settings: google_services: ################ # Sample Analytics Code replace with you own tracking code ################ analytics: enabled: true tracking_id: UA-XXXXXXXX-X tracker_name: __rz_gaTracker ################ # Sample GTM Code replace with you own tracking code ################ tag_manager: enabled: true gtm_id: GTM-XXXXXX ################ # Google Client API ################ client_api: ################ # Google Client API Public API ################ public: app_name: rz-cms-XXXXXX api_key: ~ site_name: rz-cms ################ # Google Client API Service Account ################ service: app_name: ~ client_id: ~ client_email: ~ certificate_fingerprint: ~ certificate_key: %kernel.root_dir%/config/rmzamora/rz/google_api_key/YOUR_KEY_HERE.json certificate_p12: %kernel.root_dir%/config/rmzamora/rz/google_api_key/YOUR_KEY_HERE.p12 certificate_password: XXXXXXXX ################ # Google Client API Web Application ################ web_app: client_id: ~ client_secret: ~

View Twig Helper

google analytics tracking code:, (*8)

{{ rz_google_analytics_tracking_code() }}

google analytics event ie:pageview:, (*9)

{{ rz_google_analytics_page_view() }}  

google analytics custom event ie:pageview with paramters:, (*10)

{{ rz_google_analytics_page_view_custom({'page': /MY_PAGE_URL}) }}

google analytics dashboard requires RzBlockBundle and RzAdminBundle:, (*11)

{{ rz_google_service_analytics_embed_api() }} //embed code required to use Analytics EmbedAPI

# SHOW YOUR SITE ANALYTICS on YOUR SonataAdmin Dashbaord - sonata_admin.yml
dashboard:
    blocks:
        - { position: top, type: rz_google_api_client.block.admin_ga_site_traffic, settings: { mode: admin, title: Google Analytics } }

# Register Block under sonata_block.yml           
rz_google_api_client.block.admin_ga_site_traffic:
    contexts: [admin]

### screenshot

Alt text, (*12)

Back to: rzproject, (*13)

The Versions

30/07 2016

dev-master

9999999-dev http://github.com/rzproject/RzGoogleAPIClientBundle

A Symfony2 Wrapper for the Google APIs Client Library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

google api

15/06 2016

1.0.x-dev

1.0.9999999.9999999-dev http://github.com/rzproject/RzGoogleAPIClientBundle

A Symfony2 Wrapper for the Google APIs Client Library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

google api