Skip to content

Commit f99e8af

Browse files
committed
fix: deprecate Analytics->setNonPersonalizedAds
1 parent 40e3966 commit f99e8af

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/Analytics.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ public function getRequiredParams(): array
6161
return $return;
6262
}
6363

64-
public function setNonPersonalizedAds(bool $exclude)
65-
{
66-
$this->non_personalized_ads = $exclude;
67-
return $this;
68-
}
69-
7064
public function setClientId(string $id)
7165
{
7266
$this->client_id = $id;
@@ -112,7 +106,7 @@ public function addEvent(Facade\Type\EventType ...$events)
112106
return $this;
113107
}
114108

115-
public function consent()
109+
public function consent(): ConsentHelper
116110
{
117111
return $this->consent;
118112
}
@@ -204,13 +198,20 @@ public static function new(string $measurementId, string $apiSecret, bool $debug
204198
* Deprecated references
205199
*/
206200

207-
/** @deprecated 1.1.1 */
201+
/** @deprecated 1.1.9 Please use `Analytics->consent->setAdPersonalizationPermission()` instead */
202+
public function setNonPersonalizedAds(bool $exclude)
203+
{
204+
$this->consent->setAdPersonalizationPermission(!$exclude);
205+
return $this;
206+
}
207+
208+
/** @deprecated 1.1.1 Please use `Analytics->consent->setAdPersonalizationPermission()` instead */
208209
public function allowPersonalisedAds(bool $allow)
209210
{
210-
$this->setNonPersonalizedAds(!$allow);
211+
$this->consent->setAdPersonalizationPermission($allow);
211212
}
212213

213-
/** @deprecated 1.1.1 */
214+
/** @deprecated 1.1.1 Please use `Analytics->setTimestampMicros()` instead */
214215
public function setTimestamp(int|float $microOrUnix)
215216
{
216217
$this->setTimestampMicros($microOrUnix);

0 commit comments

Comments
 (0)