laravel-ab
laravel-ab copied to clipboard
Goals not being added
Hi there - thanks for creating this! I'm hoping it will prove to be really helpful as we try to tweak our startup site.
One thing I'm running into an issue on is that the goals don't seem to be saved/reported anywhere. The bits in my config file are:
/*
|--------------------------------------------------------------------------
| Experiments
|--------------------------------------------------------------------------
|
| A list of experiment identifiers.
|
| Example: ['big-logo', 'small-buttons']
|
*/
'experiments' => [
'plenty-button',
'want-have-buttons'
],
/*
|--------------------------------------------------------------------------
| Goals
|--------------------------------------------------------------------------
|
| A list of goals. This list can contain urls, route names or custom goals.
|
| Example: ['pricing/order', 'signup']
|
*/
'goals' => [
'signup',
'save/tile',
'create/tile',
'signin'
]
And when I run php artisan ab:report, I see:
+-------------------+----------+--------------+
| Experiment | Visitors | Engagement |
+-------------------+----------+--------------+
| plenty-button | 1 | 200.00 % (2) |
| want-have-buttons | 0 | 0.00 % (0) |
+-------------------+----------+--------------+
The percentages seem off, but also my goals aren't there (not in the DB table either). I've tried re-running the install, flushing, etc. Any ideas?
I have noticed that there are some issues with the current code as well. Will try to take a look at it soon.
Thanks for the quick reply, @jenssegers. I see in the Command.php, the Goals models (and config options) are never being initiated. I have a fix for this on my fork (which I will happily submit a PR for), but my current question is more related to the DB structure.
When I initiate the Goals in the Command.php per my fix, it does successfully add data into the goals table (yay!), but the experiments column is blank. I'm curious how, in the current config, it would know which goals apply to which experiments. They're both just single-dimension arrays right now, so there's no correlation between goals and experiments, so no way to carry over that logic to the DB data. (I might certainly be missing something here - feel free to set me straight.)
I'd think we need an associative array or perhaps a JSON or YML config file? If you agree, this is something I can work on.
Is it working now?
I don't think a new release has been pushed out to packagist, has it? If not, it's hard to tell if any fixes are working in production
I just tagged a new release.