Skip to content

Commit 1b2ce3a

Browse files
committed
Analytics: Fix update consent method
1 parent e60188d commit 1b2ce3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/analytics/src/helpers.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ function wrapGtag(
304304
gtagParams as GtagConfigOrEventParams
305305
);
306306
} else if (command === GtagCommand.CONSENT) {
307-
const [gtagParams] = args;
307+
// If CONSENT, second arg must be 'default' or 'update'
308+
const [gtagMethod, gtagParams] = args;
308309
gtagCore(GtagCommand.CONSENT, 'update', gtagParams as ConsentSettings);
309310
} else if (command === GtagCommand.GET) {
310311
const [measurementId, fieldName, callback] = args;

0 commit comments

Comments
 (0)