Merge branch 'dev' into script-simplification

This commit is contained in:
Mike Cao 2025-05-05 18:59:11 -05:00 committed by GitHub
commit 9101f8a478
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
109 changed files with 17911 additions and 11822 deletions

View file

@ -46,6 +46,7 @@
url: currentUrl,
referrer: currentRef,
tag,
id: identity ? identity : undefined,
});
const hasDoNotTrack = () => {
@ -174,7 +175,20 @@
return send(getPayload());
};
const identify = data => send({ ...getPayload(), data }, 'identify');
const identify = (id, data) => {
if (typeof id === 'string') {
identity = id;
}
cache = '';
return send(
{
...getPayload(),
data: typeof id === 'object' ? id : data,
},
'identify',
);
};
/* Start */
@ -190,6 +204,7 @@
let initialized = false;
let disabled = false;
let cache;
let identity;
if (autoTrack && !trackingDisabled()) {
if (document.readyState === 'complete') {