All is explain here.
The bundle can be configured quite easily, and of course you can change the configuration given your environment (dev, test, prod):
# app/config/config.yml
widop_google_analytics:
client_id: "XXXXXXXXXXXX@developer.gserviceaccount.com"
profile_id: "ga:XXXXXXXX"
private_key_file: "%kernel.root_dir%/Resources/bin/myPrivateKey.p12"
http_adapter: "widop_http_adapter.curl"
The client_id
, profile_id
and private_key_file
parameters are mandatory while the http_adapter
is optionnal.
By default, this parameter is set to widop_http_adapter.curl
. If you want to change the http adapter you can take a
look at the WidopHttpAdapterBundle documentation.
For testing purpose, you can change the google analytics url used internally by the bundle to fetch you datas:
# app/config/config_test.yml
widop_google_analytics:
service_url: http://your-own-url
The query documentation is available here. To create a new one:
$query = $this->container->get('widop_google_analytics.query');
The client documentation is available here. To get it:
$client = $this->container->get('widop_google_analytics.client');
The service documentation is available here. To get it:
$service = $this->container->get('widop_google_analytics');