Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit a09bee3

Browse files
author
Joel Worrall
committed
fix: resolved cookie domain logic + make sure we call first page.
1 parent 2ad8eda commit a09bee3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/CookieApprovalDialog.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ class CookieApprovalDialog extends React.Component {
1818
process.env.ENV || process.env.NODE_ENV || 'development';
1919
const options = { expires: 365 };
2020
const { hostname } = window.location;
21-
if (currentEnvironment !== 'production' && !hostname.includes('staging')) {
21+
if (currentEnvironment === 'production' && hostname.includes('newrelic.com')) {
2222
options.domain = 'newrelic.com';
2323
}
2424
Cookies.set('newrelic-gdpr-consent', !!answer, options);
25-
// console.debug(Cookies.get('newrelic-gdpr-consent'));
25+
if (answer && window.trackGoogleAnalytics) {
26+
window.trackGoogleAnalytics();
27+
}
28+
//console.debug(Cookies.get('newrelic-gdpr-consent'));
2629
this.setState({ cookieSet: true });
2730
}
2831

0 commit comments

Comments
 (0)