• This repository has been archived on 10/Jan/2024
  • Stars
    star
    1
  • Language
    HTML
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Composer package for Laravel

GoogleAnalytics

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This package is for Laravel and shows pageviews and other data from Google Analytics in your admin page. You only need setup the credentials to communicate with Google Analytics.


Installation

add this to your composer.json

"require": {
    "abr4xas/GoogleAnalytics": "dev-master"
}

and

$ composer update
$ composer dump-autoload -o // optional

Next up the service provider must be registered:

'providers' => [
    ...
    Spatie\Analytics\AnalyticsServiceProvider::class,
    Abr4xas\GoogleAnalytics\GoogleAnalyticsServiceProvider::class,
];

...

'aliases' => [
    ...
    'Analytics' => Spatie\Analytics\AnalyticsFacade::class,
    ...
];

Next up routes:

//Google Analytics
Route::get('analytics', 'AnalyticsController@index')->name('analytics');
Route::get('analytics-mobile', 'AnalyticsController@mobile')->name('analytics-mobile');
Route::get('analytics-returning', 'AnalyticsController@newreturningsessions')->name('analytics-returning');
Route::get('analytics-operating', 'AnalyticsController@operatingsystem')->name('analytics-operating');
Route::get('analytics-traffic', 'AnalyticsController@traffic')->name('analytics-traffic');
Route::get('analytics-time-on-site', 'AnalyticsController@timeonsite')->name('analytics-time-on-site');
Route::get('analytics-referring-sites', 'AnalyticsController@referringsites')->name('analytics-referring-sites');
Route::get('analytics-search-engines', 'AnalyticsController@searchengines')->name('analytics-search-engines');
Route::get('analytics-keywords', 'AnalyticsController@keywords')->name('analytics-keywords');
Route::get('analytics-topcontent', 'AnalyticsController@topcontent')->name('analytics-topcontent');
Route::get('analytics-top-landing-pages', 'AnalyticsController@toplandingpages')->name('analytics-top-landing-pages');
Route::get('analytics-top-exit-pages', 'AnalyticsController@topexitpages')->name('analytics-top-exit-pages');

Follow the instruction at spatie/laravel-analytics and add download a json file and save as a service-account-credentials.json under storage/app/googleanalytics/ folder.

Add ANALYTICS_VIEW_ID to .env file. Add Chart.js to header.

Menu

<li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
	<i class="fa fa-line-chart"></i>  
	{{ trans('googleanalytics::googleanalytics.analytics') }}
	<span class="caret"></span>
   </a>
   <ul class="dropdown-menu">
        <li>
            <a href="{{ route('analytics') }}">
                <i class="fa fa-pie-chart"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.analyticsbasic') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-mobile') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.mobile-traffic') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-returning') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.returningsessions') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-operating') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.operatingsystem') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-traffic') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.trafficsources') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-time-on-site') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.timeonsite') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-referring-sites') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.referringsites') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-search-engines') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.searchengines') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-keywords') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.keywords') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-topcontent') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.topcontent') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-top-landing-pages') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.toplandingpages') }}</span>
            </a>
        </li>
        <li>
            <a href="{{ route('analytics-top-exit-pages') }}">
                <i class="fa fa-table"></i> 
                <span>{{ trans('googleanalytics::googleanalytics.topexitpages') }}</span>
            </a>
        </li>
    </ul>
</li> 

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

Credits

License

The MIT License (MIT). Please see License File for more information.

More Repositories

1

instapago

Plugin instapago para woocommerce.
PHP
18
star
2

php-instapago

Librería Instapago para PHP
PHP
17
star
3

node-instapago

Librería Instapago para Node.js
JavaScript
13
star
4

bancos-json

Código y Bancos correspondientes de Venezuela
11
star
5

location

PHP
5
star
6

post

los post de mi blog .md
4
star
7

vagrant-config

My vagrant config
PHP
4
star
8

laravel-plans

Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countable features.
PHP
4
star
9

uruguay-noma

Comando para crear una tabla con los datos de departamentos y localidades de #Uruguay
PHP
3
star
10

utils

Paquete de uso personal con cosas que uso día a día...
PHP
3
star
11

gmaps-input-backpack

Custom Google Maps Input for Laravel Backpack
Blade
2
star
12

blog.abr4xas.org

Mi blog, con laravel
HTML
2
star
13

simple-blog

PHP
2
star
14

pblog

My pelican blog config...
Makefile
2
star
15

enlamano

Paquete para usar el webservice de la financiera "En la mano"
PHP
1
star
16

publish-to-dev-to

PHP
1
star
17

convert

:D
PHP
1
star
18

workbench

Script para preparar el entorno para compilar una ROM para Firefox OS [DEBIAN]
Shell
1
star
19

flexgen

flexgen - A Front End Post (free) HTML5, responsive template
CSS
1
star
20

aprende

PHP
1
star
21

chatter

A simple forum package for your laravel app
PHP
1
star
22

handletranslations

PHP
1
star
23

oauth2-twitch

Twitch Helix Provider for OAuth 2.0 Client
PHP
1
star
24

react-native-crea-aplicaciones-para-android-y-ios-con-react

JavaScript
1
star
25

reportpayment

Only for Direct Bank Transfer, or Bank Account Clearing System (BACS) (Available only for Venezuela)
PHP
1
star
26

dotfiles

Mis dotfiles
Shell
1
star
27

bofh-excuses

BOFH excuses, another foolish wp plugin.
PHP
1
star
28

mvd-omnibus

Pequeña librería para consultar las rutas y los horarios de llegada del bondi
PHP
1
star
29

ReFu

Regulatory functions, an wordpess plug-in
PHP
1
star
30

abr4xas

1
star
31

MorrisJS-Test

Ejemplo de uso de Morris JS con php para crear gráficos.
PHP
1
star
32

memeticones

PHP
1
star