File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace AlexWestergaard \PhpGa4 \Facade \Type ;
4+
5+ /**
6+ * Use this type to skip reserved names of events inside the EventHelper.
7+ * NOTICE: reserved names will not pass debugging, be careful with this.
8+ */
9+ interface GtmEventType extends EventType
10+ {
11+ }
Original file line number Diff line number Diff line change 22
33namespace AlexWestergaard \PhpGa4 \Helper ;
44
5+ use AlexWestergaard \PhpGa4 \Facade \Type \GtmEventType ;
56use AlexWestergaard \PhpGa4 \Facade \Type \EventType ;
67use AlexWestergaard \PhpGa4 \Facade \Type \DefaultEventParamsType ;
78use AlexWestergaard \PhpGa4 \Facade \Type \CampaignType ;
@@ -88,7 +89,7 @@ public function toArray(): array
8889 throw Ga4EventException::throwNameTooLong ();
8990 } elseif (preg_match ('/[^\w\d\-]/ ' , $ name )) {
9091 throw Ga4EventException::throwNameInvalid ();
91- } elseif (in_array ($ name , EventType::RESERVED_NAMES )) {
92+ } elseif (in_array ($ name , EventType::RESERVED_NAMES ) && !( $ this instanceof GtmEventType) ) {
9293 throw Ga4EventException::throwNameReserved ($ name );
9394 } else {
9495 $ return ['name ' ] = $ name ;
You can’t perform that action at this time.
0 commit comments