PHP API

Goals

This package provides a facade for interacting with experiments:
\Thoughtco\StatamicABTester\Facades\Goal

Find a goal

use Thoughtco\StatamicABTester\Facades\Goal;

$goal = Goal::find('goal_handle');

Get all goals

use Thoughtco\StatamicABTester\Facades\Goal;

Goal::all();

Query goals

use Thoughtco\StatamicABTester\Facades\Goal;

Goal::query()
	->where('title', 'test')
	->get();

Complete a goal

use Thoughtco\StatamicABTester\Facades\Goal;

Goal::completed($goalHandle, $customData = []);

Goal failed

use Thoughtco\StatamicABTester\Facades\Goal;

Goal::failed($goalHandle, $customData = []);

Goal results

use Thoughtco\StatamicABTester\Facades\Goal;

Goal::find('goal_handle')->resultsQuery()->get();

Previous

Experiments