File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ class ExampleController
97
97
{
98
98
public function __invoke(Client $client)
99
99
{
100
- $buttonColor = $client->experiments()->run(uniqid(), 'button_color');
100
+ $userId = auth()->user()->id;
101
+ $buttonColor = $client->experiments()->run($userId, 'button_color');
101
102
return view('button', [
102
103
'color' => $buttonColor->getBranchId(),
103
104
]);
@@ -132,12 +133,13 @@ class ExampleController
132
133
{
133
134
public function __invoke(Client $client, StatEventBuilder $statEventBuilder)
134
135
{
136
+ $userId = auth()->user()->id;
135
137
//sending button_click event as button_click+1
136
138
$client->statistics()->sendEvent(
137
139
$eventBuilder
138
140
->incremental()
139
141
->event('button_click')
140
- ->setUserId($userSignature )
142
+ ->setUserId($userId )
141
143
->build()
142
144
);
143
145
@@ -147,7 +149,7 @@ class ExampleController
147
149
->summarize()
148
150
->event('purchase')
149
151
->setValue(30)
150
- ->setUserId($userSignature )
152
+ ->setUserId($userId )
151
153
->build()
152
154
);
153
155
}
You can’t perform that action at this time.
0 commit comments