1. Go to this page and download the library: Download based/fathom library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
based / fathom example snippets
$fathom = new Fathom('token');
$fathom->account();
$fathom = new Fathom('token');
$fathom->sites()->get(
limit: 10, // A limit on the number of objects to be returned, between 1 and 100
next: true // Paginate requests
);
$site = $fathom->sites()->getSite(
siteId: 'BASED', // The ID of the site you wish to load
);
$fathom->sites()->create(
name: 'purple-peak',
sharing: 'private', // The sharing configuration. Supported values are: `none`, `private` or `public`. Default: `none`
password: 'secret', // When sharing is set to private, you must also send a password to access the site with.
);
$fathom->sites()->update(
siteId: 'BASED',
name: 'purple-peak',
sharing: Sharing::NONE,
password: 'secret',
);
// Wipe all pageviews & event completions from a website
$fathom->sites()->wipe($siteId);
$fathom->sites()->delete($siteId);
$fathom = new Fathom('token');
$fathom->events()->get(
siteId: 'BASED', // The ID of the site you wish to load events for
limit: 10, // A limit on the number of objects to be returned, between 1 and 100
next: true // Paginate requests
);
$fathom->events()->getEvent($siteId, $eventId);
$fathom->events()->create(
siteId: 'purple-peak',
name: 'Purchase early access',
);
$fathom->events()->update(
siteId: 'BASED',
eventId: 'purchase-early-access',
name: 'Purchase early access (live)',
);
// Wipe all pageviews & event completions from a webevent
$fathom->events()->wipe($siteId, $eventId);
$fathom->events()->delete($siteId, $eventId);