Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 8 additions & 3 deletions src/containers/error-boundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ErrorBoundary extends React.Component {
// Display fallback UI
this.setState({
hasError: true,
errorId: window.Raven ? window.Raven.lastEventId() : null
errorId: window.Sentry ? window.Sentry.lastEventId() : null
});

// Log errors to analytics, separating supported browsers from unsupported.
Expand All @@ -37,8 +37,13 @@ class ErrorBoundary extends React.Component {
action: this.props.action,
label: error.message
});
if (window.Raven) {
window.Raven.captureException(error, {extra: info});
if (window.Sentry) {
window.Sentry.withScope(scope => {
Object.keys(info).forEach(key => {
scope.setExtra(key, info[key]);
});
window.Sentry.captureException(error);
});
}
} else {
analytics.event({
Expand Down
2 changes: 1 addition & 1 deletion src/lib/analytics.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import GoogleAnalytics from 'react-ga';

GoogleAnalytics.initialize(process.env.GA_ID, {
GoogleAnalytics.initialize(process.env.GA_ID || window.GA_ID, {
debug: (process.env.NODE_ENV !== 'production'),
titleCase: true,
sampleRate: (process.env.NODE_ENV === 'production') ? 100 : 0,
Expand Down