Skip to content

Commit

Permalink
Merge pull request #1516 from sharetribe/fix-undefined-GA-id
Browse files Browse the repository at this point in the history
Fix undefined REACT_APP_GOOGLE_ANALYTICS_ID
  • Loading branch information
Gnito authored May 19, 2022
2 parents 7000098 + 1dbf90f commit ca5da0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@ way to update this template, but currently, we follow a pattern:

## Upcoming version 2022-XX-XX

## [v8.6.1] 2022-05-19

- [fix] undefined REACT_APP_GOOGLE_ANALYTICS_ID caused an error.
[#1516](https://github.com/sharetribe/ftw-daily/pull/1516)

[v8.6.1]: https://github.com/sharetribe/ftw-daily/compare/v8.6.0...v8.6.1

## [v8.6.0] 2022-05-19

Note: this caused an error. Use v8.6.1 instead.

- [change] Google Analytics: remove Universal Analytics and start supporting GA4.

NOTE: you need to update the Google Analytics id to GA4's id (starting with 'G-' prefix).
Expand Down
2 changes: 1 addition & 1 deletion server/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ exports.render = function(requestUrl, context, data, renderApp, webExtractor) {
// See: https://developers.google.com/analytics/devguides/collection/gtagjs
const googleAnalyticsId = process.env.REACT_APP_GOOGLE_ANALYTICS_ID;
// Add Google Analytics script if correct id exists (it should start with 'G-' prefix)
const hasGoogleAnalyticsv4Id = googleAnalyticsId.indexOf('G-') === 0;
const hasGoogleAnalyticsv4Id = googleAnalyticsId?.indexOf('G-') === 0;

// Google Analytics: gtag.js
// NOTE: FTW is a single-page application (SPA).
Expand Down

0 comments on commit ca5da0d

Please sign in to comment.