Skip to content
This repository was archived by the owner on Mar 30, 2026. It is now read-only.

OpenCompanyApp/integration-plausible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Tool Plausible

Plausible Analytics AI tool for the Laravel AI SDK — query stats, realtime visitors, manage sites and goals. Part of the OpenCompany AI tool ecosystem.

Give your AI agents access to privacy-friendly web analytics. Query traffic data, track realtime visitors, and manage sites and conversion goals — all through the Plausible Analytics API.

About OpenCompany

OpenCompany is an AI-powered workplace platform where teams deploy and coordinate multiple AI agents alongside human collaborators. It combines team messaging, document collaboration, task management, and intelligent automation in a single workspace — with built-in approval workflows and granular permission controls so organizations can adopt AI agents safely and transparently.

This Plausible tool lets AI agents query website analytics, monitor realtime traffic, and manage tracking configuration — giving agents data-driven awareness of web properties.

OpenCompany is built with Laravel, Vue 3, and Inertia.js. Learn more at github.com/OpenCompanyApp.

Installation

composer require opencompanyapp/ai-tool-plausible

Laravel auto-discovers the service provider. No manual registration needed.

Configuration

This tool requires a Plausible Analytics API key.

In OpenCompany, credentials are managed through the Integrations UI.

For standalone usage, create config/ai-tools.php:

return [
    'plausible' => [
        'api_key' => env('PLAUSIBLE_API_KEY'),
        'url'     => env('PLAUSIBLE_URL', 'https://plausible.io'),
        'sites'   => ['example.com', 'blog.example.com'],
    ],
];

Available Tools

Tool Type Description
plausible_query_stats read Query website analytics — aggregate, timeseries, breakdowns by dimension
plausible_realtime_visitors read Current realtime visitor count (last 5 minutes)
plausible_list_sites read List all tracked websites
plausible_create_site write Register a new website for tracking
plausible_delete_site write Remove a website from tracking
plausible_list_goals read List conversion goals for a site
plausible_create_goal write Create a conversion goal (page visit or custom event)
plausible_delete_goal write Delete a conversion goal

Quick Start

use Laravel\Ai\Facades\Ai;
use OpenCompany\AiToolPlausible\PlausibleService;
use OpenCompany\AiToolPlausible\Tools\PlausibleQueryStats;
use OpenCompany\AiToolPlausible\Tools\PlausibleRealtimeVisitors;

// Create tools
$service = app(PlausibleService::class);
$tools = [
    new PlausibleQueryStats($service),
    new PlausibleRealtimeVisitors($service),
];

// Use with an AI agent
$response = Ai::agent()
    ->tools($tools)
    ->prompt('How many visitors did example.com get this month?');

Via ToolProvider (recommended)

If you have ai-tool-core installed, all 8 tools auto-register with the ToolProviderRegistry:

use OpenCompany\AiToolCore\Support\ToolProviderRegistry;

$registry = app(ToolProviderRegistry::class);
$provider = $registry->get('plausible');

// Create any tool via the provider
$tool = $provider->createTool(
    \OpenCompany\AiToolPlausible\Tools\PlausibleQueryStats::class
);

Standalone Service Usage

use OpenCompany\AiToolPlausible\PlausibleService;

$service = app(PlausibleService::class);

// Query stats
$stats = $service->query([
    'site_id' => 'example.com',
    'metrics' => ['visitors', 'pageviews'],
    'date_range' => '30d',
]);

// Realtime visitors
$count = $service->realtimeVisitors('example.com');

// List sites
$sites = $service->listSites();

// Manage goals
$goals = $service->listGoals('example.com');
$service->createGoal('example.com', ['goal_type' => 'event', 'event_name' => 'Signup']);

Dependencies

Package Purpose
opencompanyapp/ai-tool-core ToolProvider contract and registry
laravel/ai Laravel AI SDK Tool contract

Requirements

License

MIT — see LICENSE

About

Plausible Analytics AI tools for the Laravel AI SDK — query stats, realtime visitors, manage sites and goals. Part of the OpenCompany AI tool ecosystem.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages