Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: microsoft clarity identify error handling #1948

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,17 @@
if (context?.traits?.customPageId) {
customPageId = context.traits.customPageId;
}
window.clarity('identify', userId, sessionId, customPageId);
if (context?.traits) {
const { traits } = context;
const keys = Object.keys(traits);
keys.forEach(key => {
window.clarity('set', key, traits[key]);
});
}
window.clarity('identify', userId, sessionId, customPageId).then(() => {

Check warning on line 58 in packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js#L58

Added line #L58 was not covered by tests
if (context?.traits) {
const { traits } = context;
const keys = Object.keys(traits);
keys.forEach(key => {
window.clarity('set', key, traits[key]);

Check warning on line 63 in packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js#L60-L63

Added lines #L60 - L63 were not covered by tests
});
}
sanpj2292 marked this conversation as resolved.
Show resolved Hide resolved
}).catch(error => {
logger.error('Error in identify call', error);

Check warning on line 67 in packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js#L67

Added line #L67 was not covered by tests
});
sanpj2292 marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down