File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -130,21 +130,16 @@ public function post(): void
130130 ["consent " => $ this ->consent ->toArray ()],
131131 );
132132
133- $ chunkUserProperties = array_chunk ($ this ->user_properties , 25 , true );
134- $ this ->user_properties = [];
135-
136133 $ chunkEvents = array_chunk ($ this ->events , 25 );
137134 $ this ->events = [];
138135
139- $ chunkMax = count ($ chunkEvents ) > count ($ chunkUserProperties ) ? count ($ chunkEvents ) : count ($ chunkUserProperties );
140-
141- for ($ chunk = 0 ; $ chunk < $ chunkMax ; $ chunk ++) {
142- $ body ['user_properties ' ] = $ chunkUserProperties [$ chunk ] ?? [];
136+ foreach ($ chunkEvents as $ events ) {
137+ $ body ['user_properties ' ] = $ this ->user_properties ;
143138 if (empty ($ body ['user_properties ' ])) {
144139 unset($ body ['user_properties ' ]);
145140 }
146141
147- $ body ['events ' ] = $ chunkEvents [ $ chunk ] ?? [] ;
142+ $ body ['events ' ] = $ events ;
148143 if (empty ($ body ['events ' ])) {
149144 unset($ body ['events ' ]);
150145 }
Original file line number Diff line number Diff line change @@ -43,10 +43,11 @@ public function setTimestampMicros(int|float $microOrUnix);
4343 public function setNonPersonalizedAds (bool $ allow );
4444
4545 /**
46- * The user properties for the measurement
46+ * The user properties for the measurement (Up to 25 custom per project, see link)
4747 *
4848 * @var user_properties
4949 * @param AlexWestergaard\PhpGa4\Facade\Type\UserProperty $prop
50+ * @link https://support.google.com/analytics/answer/14240153
5051 */
5152 public function addUserProperty (UserPropertyType ...$ props );
5253
You can’t perform that action at this time.
0 commit comments