diff --git a/index.html b/index.html index 965a1993cd5..0d1e84fc4a2 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,9 @@
+ diff --git a/karma.conf.js b/karma.conf.js index bb5a9fdf485..6e0835b76ae 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -59,7 +59,8 @@ module.exports = function(config) { ENV_API_ROOT: null, ENV_LOGIN_ROOT: null, ENV_APP_ROOT: null, - ENV_GA_ID: null + ENV_GA_ID: null, + ENV_WEBENGAGE_ID: null }), new CircularDependencyPlugin({ failOnError: true, diff --git a/src/constants.js b/src/constants.js index 4c05bff1be1..9dbc40ab5d3 100644 --- a/src/constants.js +++ b/src/constants.js @@ -2,6 +2,7 @@ export const API_ROOT = ENV_API_ROOT || 'https://api.alpha.linode.com/v4'; // es export const LOGIN_ROOT = ENV_LOGIN_ROOT || 'https://login.alpha.linode.com'; // eslint-disable-line no-undef export const APP_ROOT = ENV_APP_ROOT || 'http://localhost:3000'; // eslint-disable-line no-undef export const GA_ID = ENV_GA_ID || '000000'; // eslint-disable-line no-undef +export const WEBENGAGE_ID = ENV_WEBENGAGE_ID || ''; // eslint-disable-line no-undef export const LinodeStates = { pending: [ diff --git a/src/index.js b/src/index.js index 3146d259b5b..8dabbf1bf27 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,8 @@ import { Router, Route, IndexRedirect, browserHistory } from 'react-router'; import DevTools from './components/DevTools'; import { syncHistoryWithStore } from 'react-router-redux'; import ReactGA from 'react-ga'; -import { GA_ID } from './constants'; +import { GA_ID, WEBENGAGE_ID } from './constants'; +import { getStorage } from './storage'; import checkLogin, { initializeAuthentication } from './session'; @@ -67,5 +68,13 @@ const init = () => { document.getElementById('root') ); }; - +if (window.webengage) { // eslint-disable-line no-undef + webengage.init(WEBENGAGE_ID); // eslint-disable-line no-undef + webengage.feedback.options('formData', [ // eslint-disable-line no-undef + { + name: 'email', + value: getStorage('authentication/email'), + }, + ]); +} window.init = init; diff --git a/webpack.config.dev.js b/webpack.config.dev.js index 97c83342e1c..c9891206d69 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -22,7 +22,8 @@ module.exports = { 'ENV_API_ROOT': JSON.stringify(process.env.API_ROOT), 'ENV_LOGIN_ROOT': JSON.stringify(process.env.LOGIN_ROOT), 'ENV_APP_ROOT': JSON.stringify(process.env.APP_ROOT), - 'ENV_GA_ID': JSON.stringify(process.env.GA_ID) + 'ENV_GA_ID': JSON.stringify(process.env.GA_ID), + 'ENV_WEBENGAGE_ID': JSON.stringify(process.env.WEBENGAGE_ID) }) ], module: { diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 38d3fdae564..fc0154c9cc0 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -13,7 +13,8 @@ _.plugins = [ 'ENV_APP_ROOT': JSON.stringify(process.env.APP_ROOT), 'ENV_API_ROOT': JSON.stringify(process.env.API_ROOT), 'ENV_LOGIN_ROOT': JSON.stringify(process.env.LOGIN_ROOT), - 'ENV_GA_ID': JSON.stringify(process.env.GA_ID) + 'ENV_GA_ID': JSON.stringify(process.env.GA_ID), + 'ENV_WEBENGAGE_ID': JSON.stringify(process.env.WEBENGAGE_ID) }), new webpack.optimize.UglifyJsPlugin({ compressor: {