Laravel wrapper for the Fathom Analytics API

Overview

Please note: This package is still a work in progress and the Fathom API is also only in early access. Do not use this package in your production environment (yet).

Laravel Fathom

Packagist Version Packagist Downloads tests CodeQuality CodeFactor codecov GitHub Gitmoji

This is a Laravel wrapper for the Fathom Analytics API.

Fathom Analytics

Installation

coming soon...

Usage

Get Account

use MarcReichel\LaravelFathom\Fathom;

Fathom::account()->get();

List Sites

use MarcReichel\LaravelFathom\Fathom;

Fathom::sites()->get();

Limit the results

use MarcReichel\LaravelFathom\Fathom;

Fathom::sites()->limit(5)->get();

Pagination

use MarcReichel\LaravelFathom\Fathom;

Fathom::sites()->after('CDBUGS')->get();
Fathom::sites()->before('CDBUGS')->get();

Get Site

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')->get();

Create Site

use MarcReichel\LaravelFathom\Fathom;

Fathom::sites()->create([
    'name' => 'Acme Inc', // required
    'sharing' => 'private', // optional, one of 'none', 'private' or 'public'
    'share_password' => 'the-jean-genie', // optional
]);

Update Site

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')->update([
    'name' => 'Acme Holdings Inc',
    'sharing' => 'private',
    'share_password' => 'the-jean-genie',
]);

Wipe Site

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')->wipe();

Delete Site

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')->delete();

List Events

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')->events()->get();

Limit the results

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')->events()->limit(5)->get();

Pagination

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->events()
    ->after('signed-up-to-newsletter')
    ->get();
Fathom::site('CDBUGS')
    ->events()
    ->before('signed-up-to-newsletter')
    ->get();

Get Event

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->event('signed-up-to-newsletter')
    ->get();

Create Event

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->events()
    ->create([
        'name' => 'Purchase early access',
    ]);

Update Event

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->event('purchase-early-access')
    ->update([
        'name' => 'Purchase Early Access (live)',
    ]);

Wipe event

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->event('purchase-early-access')
    ->wipe();

Delete event

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->event('purchase-early-access')
    ->delete();

Aggregation

Pageviews

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->aggregate(['visits'])
    ->groupByDay()
    ->groupByField('referrer_hostname')
    ->orderBy('visits', 'desc')
    ->timezone('Europe/Berlin')
    ->limit(200)
    ->where('pathname', 'is', '/pricing')
    ->where('pathname', 'is not', '/login')
    ->get();

Event

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->event('signed-up-for-newsletter')
    ->aggregate(['visits'])
    ->groupByDay()
    ->groupByField('referrer_hostname')
    ->orderBy('visits', 'desc')
    ->timezone('Europe/Berlin')
    ->limit(200)
    ->where('pathname', 'is', '/pricing')
    ->where('pathname', 'is not', '/login')
    ->get();

Current visitors

use MarcReichel\LaravelFathom\Fathom;

Fathom::site('CDBUGS')
    ->currentVisitors();

Testing

Run the tests with:

composer test

Roadmap

  • Improve documentation

Contribution

Pull requests are welcome :)

You might also like...
🌶🥗🧀🍉 Brazilian Table of Food Composition made by IBGE - Laravel 9 REST API

About API of the 2008-2009 Family Budget Survey: tables of nutritional composition of foods consumed in Brazil / IBGE, Coordination of Work and Income

¡BACKEND OVER APP! API REST IMPLEMENTANDO CONCEPTOS DE ARQUITECTURA HEXAGONAL, DDD, TDD Y SOLID. HECHO EN LARAVEL & PHP
¡BACKEND OVER APP! API REST IMPLEMENTANDO CONCEPTOS DE ARQUITECTURA HEXAGONAL, DDD, TDD Y SOLID. HECHO EN LARAVEL & PHP

¡BACKEND OVER APP! API REST IMPLEMENTANDO CONCEPTOS DE ARQUITECTURA HEXAGONAL, DDD, TDD Y SOLID. HECHO EN LARAVEL & PHP

The API & platform builder, build your apps 10x faster even more, it's open source & 100% free !
The API & platform builder, build your apps 10x faster even more, it's open source & 100% free !

The API & platform builder, build your apps 10x faster, even more. It's open source & 100% free ! Try live demo Why badaso ? 100% FREE - No need for e

This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 4.0.0 platform. It allows you to query some other server information
This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 4.0.0 platform. It allows you to query some other server information

QueryServer This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 4.0.0 platform. I

Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP
Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP

MySejahtera-PHP-Web Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP. Disclaimer This web app is

Provide a module to industrialize API REST call with dependency injection using Guzzle library
Provide a module to industrialize API REST call with dependency injection using Guzzle library

Zepgram Rest Technical module to industrialize API REST call with dependency injection using Guzzle library. Provides multiple features to make your l

Simple searching for postcodes to retrieve geographic information. Support for various API providers and a unified address/output format.

Postcode Search Simple searching for postcodes to retrieve geographic information. Support for various API providers and a unified address/output form

nextcloud app that replicates basic gpodder.net api

nextcloud-gpodder Nextcloud app that replicates basic gpodder.net api This app serves as synchronization endpoint for AntennaPod: https://github.com/A

Quick and dirty PHP script to turn a Twitter feed into an RSS feed using Twitter's v2 API

Twitter to RSS Quick and dirty PHP script that turns a given Twitter feed into a RSS feed using Twitter's API v2 (the free version!) Does some basic l

Releases(0.8.1)
  • 0.8.1(Mar 2, 2022)

    What's Changed

    • update event key for page views to 'pageview' to align with API by @just-tom in https://github.com/marcreichel/laravel-fathom/pull/6

    New Contributors

    • @just-tom made their first contribution in https://github.com/marcreichel/laravel-fathom/pull/6

    Full Changelog: https://github.com/marcreichel/laravel-fathom/compare/0.8.0...0.8.1

    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Feb 11, 2022)

    What's Changed

    • Add support for Laravel 9 by @marcreichel in https://github.com/marcreichel/laravel-fathom/pull/5

    Full Changelog: https://github.com/marcreichel/laravel-fathom/compare/0.7.2...0.8.0

    Source code(tar.gz)
    Source code(zip)
  • 0.7.2(Nov 8, 2021)

    What's Changed

    • ✨ Introduce fathom:install command by @marcreichel in https://github.com/marcreichel/laravel-fathom/pull/4

    Full Changelog: https://github.com/marcreichel/laravel-fathom/compare/0.7.1...0.7.2

    Source code(tar.gz)
    Source code(zip)
  • 0.7.1(Nov 5, 2021)

  • 0.7.0(Nov 5, 2021)

  • 0.6.2(Nov 4, 2021)

  • 0.6.1(Nov 4, 2021)

  • 0.6.0(Nov 4, 2021)

  • 0.5.1(Nov 4, 2021)

  • 0.5.0(Nov 3, 2021)

  • 0.4.0(Oct 31, 2021)

    What's Changed

    • ♻️ Adjust model creation by @marcreichel in https://github.com/marcreichel/laravel-fathom/pull/3

    Full Changelog: https://github.com/marcreichel/laravel-fathom/compare/0.3.0...0.4.0

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Oct 31, 2021)

    What's Changed

    • ✨ Introduce cursor pagination by @marcreichel in https://github.com/marcreichel/laravel-fathom/pull/1
    • ✨ Introduce aggregations by @marcreichel in https://github.com/marcreichel/laravel-fathom/pull/2

    Full Changelog: https://github.com/marcreichel/laravel-fathom/compare/0.2.0...0.3.0

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Oct 31, 2021)

  • 0.1.0(Oct 30, 2021)

  • 0.0.1(Oct 30, 2021)

Owner
Marc Reichel
Hi, I'm Marc, a passionate web designer and fullstack software developer from 🇩🇪.
Marc Reichel
MixPanel for Laravel - Intuitive drop-in analytics.

MixPanel for Laravel Sponsors We like to thank the following sponsors for their generosity. Please take a moment to check them out. LIX Features Async

GeneaLabs, LLC 105 Dec 10, 2022
Flying Analytics by FlyingPress

Flying Analytics by FlyingPress

FlyingWeb Solutions 3 Sep 30, 2022
Matomo is the leading Free/Libre open analytics platform.

Matomo (formerly Piwik) - matomo.org Code Status Description Matomo is the leading Free/Libre open analytics platform. Matomo is a full-featured PHP M

Matomo Analytics 17.2k Jan 3, 2023
Provides an API wrapper for interacting with remote CiviCRM instances via APIv4.

civicrm-api is a Composer package that allows developers to interact with a CiviCRM instance using the REST API v4 functionality within CiviCRM.

Circle Interactive 1 Apr 4, 2022
Simple and lightweight OOP wrapper for PHP's low-level sockets extension (ext-sockets)

clue/socket-raw Simple and lightweight OOP wrapper for PHP's low-level sockets extension (ext-sockets). PHP offers two networking APIs, the newer stre

Christian Lück 321 Dec 15, 2022
A simple wrapper for PHP Intervention Library to provide a more simple interface and convenient way to convert images to webp

This package is a simple wrapper for PHP Intervention Library to provide a more simple interface and convenient way to convert images to webp - next generation format - extension, and resize them to render only needed sizes.

eyad hamza 18 Jun 28, 2022
Provides access to Cloudflare Images API for Laravel projects

Cloudflare Images Provides access to Cloudflare Images API for Laravel projects Table of contents Installation Configuration Using Installation To get

Dmytro 20 Dec 16, 2022
Translate laravel resource, vendor, folder or file from google translation without requiring any api information

⚡ ⚡ ⚡ Laravel Go Translate Translate laravel resource, vendor, folder or file from google translation without requiring any api information. Table of

CodeBugLab 37 Jun 18, 2022
Facebook & Instagram Ads API for Laravel

Laravel Facebook Ads Get ads infos (campaigns, ads, insights, etc...) from Facebook & Instagram Ads API Supported Facebook API version: >= v3.0 Instal

Eduardo Bizarro 108 Dec 5, 2022
Faculty Management System (FMS) Built with Laravel 9 in Back-end and React , Redux in Front-end API's

Final Project Faculty Management System (FMS) as final project for faculty of Copmuter Science, Kandahar University, 2021 Faculty Management System (F

Shahghasi Adil 7 Jun 21, 2022