Problem firing event using PHP SDK My code is som...
# ask-questions
w
Problem firing event using PHP SDK My code is something like this:
Copy code
$trackingCallback = function (
    Growthbook\InlineExperiment $experiment,
    Growthbook\ExperimentResult $result
) {
    file_put_contents('/tmp/test.log', date("Y-m-d H:i:s") . ": " . "event fired!!!" . "\n", FILE_APPEND);
};

$growthbook = Growthbook::create()
    ->withTrackingCallback($trackingCallback);

$growthbook->loadFeatures("xxxxxxxx", "<https://cdn.growthbook.io>");

if ($growthbook->isOn("test-example")) {
    echo "Feature is enabled!";
} else {
    echo "Feature is NOT enabled!";
}
r
@worried-businessperson-32427 has opened an issue Close Issue button
w
I would expect the event to be fired and write in the log file but nothing happens
Feature is enabled and experiment is running
b
Hi Dario, I'll take a look and get back to you as soon as I can. We've had a larger number of support requests today than usual so it may be a little while
w
👍
r
Hi Dario, it looks like the ID and/oror attribute information isn't being provided in the trackingCallback in the code snippet you sent. Note the example in the first code block here: https://docs.growthbook.io/lib/php#quick-usage
w
Thanks! I added the ID and now it's working! ;-)
b
Fantastic!