2017 © Pedro Peláez
 

symfony-bundle gamp-bundle

Google Analytics Measurement Protocol bundle for Symfony

image

fourlabs/gamp-bundle

Google Analytics Measurement Protocol bundle for Symfony

  • Tuesday, July 10, 2018
  • by fourlabsldn
  • Repository
  • 4 Watchers
  • 14 Stars
  • 48,597 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 12 Versions
  • 17 % Grown

The README.md

GAMP Bundle

Google Analytics Measurement Protocol Package for Symfony. Supports all GA Measurement Protocol API methods., (*1)

Build Status StyleCI Total Downloads License SensioLabsInsight, (*2)

Installation

Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest version of this bundle:, (*3)

``` bash $ composer require fourlabs/gamp-bundle, (*4)


This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation. ### Compatibility with Guzzle 5 and 6 If you are using PHP 5.5 or above and Guzzle 6 then: { "require": { "fourlabs/gamp-bundle": "^2.0" } } Or if you are using PHP 5.4 or above and Guzzle 5 then: { "require": { "fourlabs/gamp-bundle": "^1.1" } } ### Enable the Bundle Then, enable the bundle by adding the following line in the *app/AppKernel.php* file of your project: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new FourLabs\GampBundle\FourLabsGampBundle(), ); }

Usage

This bundle exposes the service gamp.analytics. It is a [non shared service][3], i.e. each time you retrieve the service you'll get a new instance., (*5)

Example

``` php $this->get('gamp.analytics') ->setTransactionId('7778922') ->setAffiliation('THE ICONIC') ->setRevenue(250.0) ->setTax(25.0) ->setShipping(15.0) ->setCouponCode('MY_COUPON') ->setProductActionToPurchase() ->setEventCategory('Checkout') ->setEventAction('Purchase') ->sendEvent() ;, (*6)


Refer to [the library's documentation][2] for other remaining methods and examples, they all work. This library 100% supports all GAMP features. > **Note:** You don't have to use the protocol version, tracking id, anonymize ip and async request (non-blocking) methods as they're automatically set in based on your config file. [2]: https://github.com/theiconic/php-ga-measurement-protocol#usage ### Configuration Example of configuration in `app/config.yml`: four_labs_gamp: protocol_version: 1 tracking_id: UA-XXXXXXX-X use_ssl: true anonymize_ip: false async_requests: true sandbox: true Set your Google Analytics Tracking / Web Property ID in `tracking_id` key **[REQUIRED]** See: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#tid ``` yaml tracking_id: UA-XXXX-Y

All other configuration options are optional, use as per your requirements., (*7)

The Protocol version. The current value is '1'. Default: 1, (*8)

See: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#v, (*9)

``` yaml protocol_version: 1, (*10)


To send data over SSL, set `use_ssl` to true. Default: true See: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#tid ``` yaml use_ssl: true

To Anonymize IP, set anonymize_ip to true. Default: false, (*11)

See: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#aip, (*12)

``` yaml anonymize_ip: true, (*13)


To Make Async Requests, set `async_requests` to true. Default: true ``` yaml async_requests: true

When sandbox mode is enabled, no hits are actually sent to GA. In this case the library returns a AnalyticsResponseInterface object that with empty values. Default: false, (*14)

yaml sandbox: true, (*15)

Credits

This package is a wrapper around the GA Measurement Protocol PHP Library. Thanks to the guys @ THE ICONIC who developed the library!, (*16)

License

MIT, (*17)

The Versions

10/07 2018

dev-master

9999999-dev https://fourlabs.co.uk

Google Analytics Measurement Protocol bundle for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

analytics google tracking gamp

10/07 2018

dev-s4

dev-s4 https://fourlabs.co.uk

Google Analytics Measurement Protocol bundle for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

analytics google tracking gamp

09/07 2018

2.3.0

2.3.0.0 https://fourlabs.co.uk

Google Analytics Measurement Protocol bundle for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

analytics google tracking gamp

02/05 2017

v2.2.0

2.2.0.0 https://fourlabs.co.uk

Google Analytics Measurement Protocol bundle for Symfony

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp

03/04 2017

v2.1.1

2.1.1.0 https://fourlabs.co.uk

Google Analytics Measurement Protocol bundle for Symfony

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp

18/11 2016

v2.1.0

2.1.0.0 https://fourlabs.co.uk

Google Analytics Measurement Protocol bundle for Symfony

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp

13/10 2016

v2.0.1

2.0.1.0 https://fourlabs.co.uk

Google Analytics Measurement Protocol Package for Symfony2

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp

13/10 2016

dev-analysis-XWogxN

dev-analysis-XWogxN https://fourlabs.co.uk

Google Analytics Measurement Protocol Package for Symfony2

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp

13/10 2016

dev-analysis-XZogjR

dev-analysis-XZogjR http://fourlabs.co.uk

Google Analytics Measurement Protocol Package for Symfony2

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp

06/06 2016

2.0.0

2.0.0.0 http://fourlabs.co.uk

Google Analytics Measurement Protocol Package for Symfony2

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp

06/06 2016

v1.x-dev

1.9999999.9999999.9999999-dev http://fourlabs.co.uk

Google Analytics Measurement Protocol Package for Symfony2

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp

06/06 2016

1.1.0

1.1.0.0 http://fourlabs.co.uk

Google Analytics Measurement Protocol Package for Symfony2

  Sources   Download

MIT

The Requires

 

analytics google tracking gamp