Download the PHP package panakour/analytics without Composer

On this page you can find all versions of the php package panakour/analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package analytics

StyleCI Latest Stable Version Total Downloads License

Get easily whatever data you want from google analytics API V4 using laravel php framework.

This package helps php developers to use Google Analytics API V4 with convenient way. The code is clean and was written with good OOP practices. Any help to improve this package would be appreciated.

The package is compatible with laravel framework.

Installation

Install the package via composer:

To use it with laravel add the GoogleAnalyticsServiceProvider to the config/app.php:

If you want to use the facade of the package add it to the config/app.php:

Copy the analytics config file with the command:

For those who have a credential with google analytics api continue here otherwise look at how to create credential with google analytics api.

Be sure that you have service-account-credentials.json file within storage\app\google-analytics\.

Add the view id to .env file:

Usage

You can get analytics data simply using the facade

Panakour\Analytics\Facades\Analytics

To get all sessions of the last week

Analytics::get();

To get all sessions depends on the specific date range
To get whatever data you want

setMetrics and setDimension methods accept an array containing the wanted metrics and dimension. Available metrics and dimensions

setDimensionFilter accept 3 parameters. First parameter get the dimension name in which you want to filter analytics data. Second parameter get the operator (REGEXP, BEGINS_WITH, ENDS_WITH and more) you want. Third parameter get the expression. For example if you want to get all analytics data in which the page path include play or simple words you can use: Analytics::setDimensionFilter('ga:pagePath', 'REGEXP', '(\/play\/|\/simple\/)');

If you want to get analytics data for multiple pages in a single request by their exact paths, you can use the 'IN_LIST' operator and pass an array of paths as the third parameter. E.g. Analytics::setDimensionFilter('ga:pagePath', 'IN_LIST', ['/i-want-data-for-this-path', '/and/this-path-too']);

setOrder method accept 3 parameters. First parameter get the name in which you want to order the data. Second get OrderType usually VALUE. Third get the SortOrder usually ASCENDING or DESCENDING.

Get data using Analytics contract

Panakour\Analytics\Contracts\Analytics

Instead of facade you can get analytics data using the Analytics interface:

Create credential with google analytics api v4

Guide from google analytics api v4: https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-php


All versions of analytics with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
illuminate/support Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0
google/apiclient Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package panakour/analytics contains the following files

Loading the files please wait ....