Skip to content

Commit 6dc83de

Browse files
authored
Update README.md
1 parent 38ac042 commit 6dc83de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ class ExampleController
9797
{
9898
public function __invoke(Client $client)
9999
{
100-
$buttonColor = $client->experiments()->run(uniqid(), 'button_color');
100+
$userId = auth()->user()->id;
101+
$buttonColor = $client->experiments()->run($userId, 'button_color');
101102
return view('button', [
102103
'color' => $buttonColor->getBranchId(),
103104
]);
@@ -132,12 +133,13 @@ class ExampleController
132133
{
133134
public function __invoke(Client $client, StatEventBuilder $statEventBuilder)
134135
{
136+
$userId = auth()->user()->id;
135137
//sending button_click event as button_click+1
136138
$client->statistics()->sendEvent(
137139
$eventBuilder
138140
->incremental()
139141
->event('button_click')
140-
->setUserId($userSignature)
142+
->setUserId($userId)
141143
->build()
142144
);
143145

@@ -147,7 +149,7 @@ class ExampleController
147149
->summarize()
148150
->event('purchase')
149151
->setValue(30)
150-
->setUserId($userSignature)
152+
->setUserId($userId)
151153
->build()
152154
);
153155
}

0 commit comments

Comments
 (0)