LaravelPackages.net
Acme Inc.
Toggle sidebar
Pschocke/nova-plausible-analytics

A Laravel Nova card to display Plausible.io Analytics in Nova.

236
1
v1.0
About Pschocke/nova-plausible-analytics

Pschocke/nova-plausible-analytics is a Laravel package for a laravel nova card to display plausible.io analytics in nova.. It currently has 1 GitHub stars and 236 downloads on Packagist (latest version v1.0). Install it with composer require Pschocke/nova-plausible-analytics. Discover more Laravel packages by Pschocke or browse all Laravel packages to compare alternatives.

Last updated

Plausible Analytics Integration with Nova

image

Display statistics from Plausible analytics directly in Laravel Nova

This package is highly inspired by the Google Analytics Integration Package from Tighten and shares some if its code.

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require pschocke/nova-plausible-analytics

API configuration

Get your Plausible API key (by logging into your account and navigating to the settings) and configure your .env file:

NOVA_PLAUSIBLE_API_KEY= #Your API key
NOVA_PLAUSIBLE_SITE_ID= #The ID you've used for the site in plausible

Next you need to add the following code snipped to your services configuration file (config/services.php)

return [
    //...
    'nova-plausible' => [
        'domain' => env('NOVA_PLAUSIBLE_DOMAIN', 'https://plausibe.io/'),
        'api-key' => env('NOVA_PLAUSIBLE_API_KEY'),
        'site-id' => env('NOVA_PLAUSIBLE_SITE_ID'),
    ]
];

##Usage ou must register the cards you want to display with Nova. This is typically done in the cards method of the NovaServiceProvider.

// in app/Providers/NovaServiceProvider.php

// ...

public function cards()
{
    return [
        // ...
        new \Pschocke\NovaPlausibleAnalytics\VisitorsMetric,
        new \Pschocke\NovaPlausibleAnalytics\SessionsByDeviceMetric,
        new \Pschocke\NovaPlausibleAnalytics\SessionsByCountryMetric,
        new \Pschocke\NovaPlausibleAnalytics\MostVisitedPagesCard,
    ];
}

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

Star History Chart