php-gacx
php-gacx copied to clipboard
Warning! Will throw fatal error if experiments ends
This caught me off guard in the early hours of this morning, 4 hours of downtime because this library throws a fatal error when the experiment ends and can't be found. Recommended fix is wrapping calls in try/catch
try {
$experiment = new GoogleAnalytics\Experiment('xxxx');
$variation = $experiment->chooseVariation();
} catch(Exception $e) {
$variation = 1;
}