forked from realreality/reality-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(analytics): GA analytics tracker from ENV variable, move ana…
…lytics logic into background pa Based on process.env.NODE_ENV either GA_TRACKER_DEV or GA_TRACKER_PROD is loaded from .evn file. Also moved the analytics from template appending mechanism to background page because of clashes with host site GA. More details in SO answer https://stackoverflow.com/questions/10285886/chrome-extension-adding-external-javascript-to-current-pages-html?answertab=active#tab-top Closes realreality#52
- Loading branch information
Showing
10 changed files
with
162 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
// tiny wrapper with default env vars | ||
const env = require('dotenv'); | ||
const dotenv = require('dotenv') | ||
|
||
env.load(); | ||
dotenv.load() | ||
|
||
const env = process.env | ||
|
||
module.exports = { | ||
|
||
PORT: (process.env.PORT || 3000), | ||
GMAPS_API_KEY: process.env.GMAPS_API_KEY, | ||
IPR_REST_API: (process.env.IPR_REST_API || 'https://realreality.publicstaticvoidmain.cz/rest') | ||
}; | ||
GA_TRACKER_DEV: env.GA_TRACKER_DEV, | ||
GA_TRACKER_PROD: env.GA_TRACKER_PROD, | ||
PORT: (env.PORT || 3000), | ||
GMAPS_API_KEY: env.GMAPS_API_KEY, | ||
IPR_REST_API: (env.IPR_REST_API || 'https://realreality.publicstaticvoidmain.cz/rest'), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters