Skip to content

Commit 22d4906

Browse files
author
Alex Westergaard
committed
Update Analytics required fields
1 parent 488447a commit 22d4906

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Analytics.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,17 @@ public function getParams(): array
4343

4444
public function getRequiredParams(): array
4545
{
46-
return [
47-
'client_id'
48-
];
46+
$return = [];
47+
48+
// Either client_id OR user_id MUST to be set
49+
if (
50+
(!isset($this->client_id) || empty($this->client_id))
51+
&& (!isset($this->user_id) || empty($this->user_id))
52+
) {
53+
$return[] = 'client_id';
54+
}
55+
56+
return $return;
4957
}
5058

5159
public function allowPersonalisedAds(bool $allow)

0 commit comments

Comments
 (0)