Fix track script regex match, argument and receiver were swapped

This commit is contained in:
Ewen Le Bihan 2023-12-17 03:46:01 +01:00
parent ef2d56fc78
commit 6361ac892b

View file

@ -42,9 +42,9 @@
const getPageviewEventData = () => Object.fromEntries( const getPageviewEventData = () => Object.fromEntries(
[...currentScript.attributes] [...currentScript.attributes]
.filter(attribute => pageviewCustomPropertyRegex.match(attribute.name)) .filter(attribute => attribute.name.match(pageviewCustomPropertyRegex))
.map(attribute => { .map(attribute => {
const match = pageviewCustomPropertyRegex.match(attribute.name); const match = attribute.name.match(pageviewCustomPropertyRegex);
return [match[1], attribute.value] return [match[1], attribute.value]
}) })
) )