Skip to content
Snippets Groups Projects
Unverified Commit b44831ba authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #1950 from paulkaplan/env-for-tracking

Move analytics things to environment vars
parents 13dd0a0f fe13e3e6
No related branches found
No related tags found
No related merge requests found
import GoogleAnalytics from 'react-ga';
GoogleAnalytics.initialize('UA-30688952-5', {
GoogleAnalytics.initialize(process.env.GA_ID, {
debug: (process.env.NODE_ENV !== 'production'),
titleCase: true,
sampleRate: (process.env.NODE_ENV === 'production') ? 100 : 0,
......
......@@ -5,14 +5,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="static/favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<!-- Sentry error logging to help with finding bugs -->
<script src="https://cdn.ravenjs.com/3.22.1/raven.min.js" crossorigin="anonymous"></script>
<script>
Raven.config('https://42b7d13da8ad4d68b13e57c5e54f9a23@sentry.io/273218').install();
</script>
<!-- /Sentry -->
<% if (htmlWebpackPlugin.options.sentryConfig) { %>
<!-- Sentry error logging to help with finding bugs -->
<script src="https://cdn.ravenjs.com/3.22.1/raven.min.js" crossorigin="anonymous"></script>
<script>
Raven.config('<%= htmlWebpackPlugin.options.sentryConfig %>').install();
</script>
<!-- /Sentry -->
<% } %>
</head>
<body>
</body>
......
......@@ -101,7 +101,8 @@ module.exports = [
plugins: base.plugins.concat([
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"' + process.env.NODE_ENV + '"',
'process.env.DEBUG': Boolean(process.env.DEBUG)
'process.env.DEBUG': Boolean(process.env.DEBUG),
'process.env.GA_ID': '"' + (process.env.GA_ID || 'UA-000000-01') + '"'
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'lib',
......@@ -110,7 +111,8 @@ module.exports = [
new HtmlWebpackPlugin({
chunks: ['lib', 'gui'],
template: 'src/playground/index.ejs',
title: 'Scratch 3.0 GUI'
title: 'Scratch 3.0 GUI',
sentryConfig: '"' + process.env.SENTRY_CONFIG + '"'
}),
new HtmlWebpackPlugin({
chunks: ['lib', 'blocksonly'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment